[ObjectHandler-cvs] ObjectHandler/oh object.hpp, 1.3, 1.4 utilities.hpp, 1.4, 1.5
Brought to you by:
ericehlers,
nando
From: Eric E. <eri...@us...> - 2006-06-07 22:10:42
|
Update of /cvsroot/objecthandler/ObjectHandler/oh In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15652/oh Modified Files: object.hpp utilities.hpp Log Message: consolidate macros Index: object.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** object.hpp 1 Jun 2006 13:59:47 -0000 1.3 --- object.hpp 6 Jun 2006 17:43:10 -0000 1.4 *************** *** 35,40 **** const CLASS& getObject() const { \ return *boost::dynamic_pointer_cast<CLASS>(POINTER); \ ! } \ ! // namespace ObjHandler { --- 35,65 ---- const CLASS& getObject() const { \ return *boost::dynamic_pointer_cast<CLASS>(POINTER); \ ! } ! ! //! ObjectHandler function retrieveObject ! /*! Declare boost shared pointer with name \a NAME and point it to ! Object having class \a CLIENT_CLASS and instance name \a INSTANCENAME. ! */ ! #define OH_GET_OBJECT( NAME, INSTANCENAME, CLIENT_CLASS ) \ ! boost::shared_ptr < CLIENT_CLASS > NAME = \ ! boost::dynamic_pointer_cast< CLIENT_CLASS > \ ! (ObjHandler::retrieveObject( INSTANCENAME )); \ ! if (!NAME) { \ ! std::ostringstream err; \ ! err << "Unable to convert instance name " << INSTANCENAME \ ! << " to object of class " #CLIENT_CLASS; \ ! throw ObjHandler::Exception(err.str()); \ ! } ! ! //! Object function getReference ! /*! Declare a boost shared pointer with name \a NAME and point it ! to object of class \a UNDERLYING_CLASS retrieved from Object ! having class \a CLIENT_CLASS and instance name \a INSTANCENAME. ! */ ! #define OH_GET_REFERENCE( NAME, INSTANCENAME, CLIENT_CLASS, UNDERLYING_CLASS ) \ ! OH_GET_OBJECT(NAME ## temp, INSTANCENAME, CLIENT_CLASS ) \ ! const boost::shared_ptr< UNDERLYING_CLASS > NAME = \ ! boost::static_pointer_cast< UNDERLYING_CLASS > \ ! ( NAME ## temp->getReference() ); namespace ObjHandler { Index: utilities.hpp =================================================================== RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** utilities.hpp 6 Jun 2006 12:57:58 -0000 1.4 --- utilities.hpp 6 Jun 2006 17:43:13 -0000 1.5 *************** *** 26,55 **** #include <oh/objecthandler.hpp> - //! ObjectHandler function retrieveObject - /*! Declare boost shared pointer with name \a NAME and point it to - Object having class \a CLIENT_CLASS and instance name \a INSTANCENAME. - */ - #define OH_GET_OBJECT( NAME, INSTANCENAME, CLIENT_CLASS ) \ - boost::shared_ptr < CLIENT_CLASS > NAME = \ - boost::dynamic_pointer_cast< CLIENT_CLASS > \ - (ObjHandler::retrieveObject( INSTANCENAME )); \ - if (!NAME) { \ - std::ostringstream err; \ - err << "Unable to convert instance name " << INSTANCENAME \ - << " to object of class " #CLIENT_CLASS; \ - throw ObjHandler::Exception(err.str()); \ - } - - //! Object function getReference - /*! Declare a boost shared pointer with name \a NAME and point it - to object of class \a UNDERLYING_CLASS retrieved from Object - having class \a CLIENT_CLASS and instance name \a INSTANCENAME. - */ - #define OH_GET_REFERENCE( NAME, INSTANCENAME, CLIENT_CLASS, UNDERLYING_CLASS ) \ - OH_GET_OBJECT(NAME ## temp, INSTANCENAME, CLIENT_CLASS ) \ - const boost::shared_ptr< UNDERLYING_CLASS > NAME = \ - boost::static_pointer_cast< UNDERLYING_CLASS > \ - ( NAME ## temp->getReference() ); - namespace ObjHandler { --- 26,29 ---- *************** *** 58,62 **** //! Retrieve ObjectHandler version string std::string version(); - /** \name ObjectHandler wrappers --- 32,35 ---- |