Update of /cvsroot/objecthandler/ObjectHandler/oh
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11165/oh
Modified Files:
object.hpp objecthandlerbase.cpp objecthandlerbase.hpp
utilities.cpp utilities.hpp
Log Message:
change "handle" to "instance name"
Index: utilities.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** utilities.cpp 19 May 2006 15:12:41 -0000 1.1
--- utilities.cpp 1 Jun 2006 13:59:47 -0000 1.2
***************
*** 36,41 ****
DLL_API ObjHandler::obj_ptr retrieveObject(
! const std::string &handle) {
! return ObjectHandler::instance().retrieveObject(handle);
}
--- 36,41 ----
DLL_API ObjHandler::obj_ptr retrieveObject(
! const std::string &instanceName) {
! return ObjectHandler::instance().retrieveObject(instanceName);
}
***************
*** 66,78 ****
}
! void logObject(const std::string &handle) {
std::ostringstream msg;
obj_ptr object =
! ObjectHandler::instance().retrieveObject(handle);
if (object) {
! msg << "log dump of object with handle = " << handle << std::endl;
msg << *object.get();
} else {
! msg << "no object in repository with handle = " << handle << std::endl;
}
Logger::instance().logMessage(msg.str());
--- 66,78 ----
}
! void logObject(const std::string &instanceName) {
std::ostringstream msg;
obj_ptr object =
! ObjectHandler::instance().retrieveObject(instanceName);
if (object) {
! msg << "log dump of object with instance name = " << instanceName << std::endl;
msg << *object.get();
} else {
! msg << "no object in repository with instance name = " << instanceName << std::endl;
}
Logger::instance().logMessage(msg.str());
Index: objecthandlerbase.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandlerbase.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** objecthandlerbase.hpp 1 Jun 2006 10:52:08 -0000 1.2
--- objecthandlerbase.hpp 1 Jun 2006 13:59:47 -0000 1.3
***************
*** 47,61 ****
//! \name storing / retrieving / deleting Objects
//@{
! //! Store Object with given handle.
! /*! Any existing Object with that handle is deleted.
*/
virtual std::string storeObject(const std::string &instanceName,
const obj_ptr &object);
! //! Retrieve Object with given handle.
! /*! Throws exception if no Object exists with that handle.
*/
virtual obj_ptr retrieveObject(const std::string &instanceName) const;
! //! Delete Object with given handle.
! /*! Does nothing if no Object exists with that handle.
*/
virtual void deleteObject(const std::string &instanceName);
--- 47,61 ----
//! \name storing / retrieving / deleting Objects
//@{
! //! Store Object with given instance name.
! /*! Any existing Object with that instance name is deleted.
*/
virtual std::string storeObject(const std::string &instanceName,
const obj_ptr &object);
! //! Retrieve Object with given instance name.
! /*! Throws exception if no Object exists with that instance name.
*/
virtual obj_ptr retrieveObject(const std::string &instanceName) const;
! //! Delete Object with given instance name.
! /*! Does nothing if no Object exists with that instance name.
*/
virtual void deleteObject(const std::string &instanceName);
Index: utilities.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/utilities.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** utilities.hpp 19 May 2006 15:12:41 -0000 1.1
--- utilities.hpp 1 Jun 2006 13:59:47 -0000 1.2
***************
*** 28,40 ****
//! ObjectHandler function retrieveObject
/*! Declare boost shared pointer with name \a NAME and point it to
! Object having class \a CLIENT_CLASS and handle \a HANDLE.
*/
! #define OH_GET_OBJECT( NAME, HANDLE, CLIENT_CLASS ) \
boost::shared_ptr < CLIENT_CLASS > NAME = \
boost::dynamic_pointer_cast< CLIENT_CLASS > \
! (ObjHandler::retrieveObject( HANDLE )); \
if (!NAME) { \
std::ostringstream err; \
! err << "Unable to convert handle " << HANDLE \
<< " to object of class " #CLIENT_CLASS; \
throw ObjHandler::Exception(err.str()); \
--- 28,40 ----
//! 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()); \
***************
*** 44,51 ****
/*! 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 handle \a HANDLE.
*/
! #define OH_GET_REFERENCE( NAME, HANDLE, CLIENT_CLASS, UNDERLYING_CLASS ) \
! OH_GET_OBJECT(NAME ## temp, HANDLE, CLIENT_CLASS ) \
const boost::shared_ptr< UNDERLYING_CLASS > NAME = \
boost::static_pointer_cast< UNDERLYING_CLASS > \
--- 44,51 ----
/*! 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 > \
***************
*** 56,61 ****
enum AnyError { InvalidInput, CaughtException };
! //! Store given Object in repository under given handle.
! /*! Any existing Objet with that handle is deleted.
*/
DLL_API std::string storeObject(
--- 56,61 ----
enum AnyError { InvalidInput, CaughtException };
! //! Store given Object in repository under given instance name.
! /*! Any existing Objet with that instance name is deleted.
*/
DLL_API std::string storeObject(
***************
*** 64,71 ****
//! Retrieve named Object from repository.
! /*! Throws an exception if no Object exists with given handle.
*/
DLL_API ObjHandler::obj_ptr retrieveObject(
! const std::string &handle);
//! Retrieve ObjectHandler version string
--- 64,71 ----
//! Retrieve named Object from repository.
! /*! Throws an exception if no Object exists with given instance name.
*/
DLL_API ObjHandler::obj_ptr retrieveObject(
! const std::string &instanceName);
//! Retrieve ObjectHandler version string
***************
*** 106,114 ****
const int &logLevel = 4);
! //! Write Object with given handle to log file.
/*! Writes a warning message to log file
! if no object is found with given handle.
*/
! void logObject(const std::string &handle);
//! Write all Objects to log file.
--- 106,114 ----
const int &logLevel = 4);
! //! Write Object with given instance name to log file.
/*! Writes a warning message to log file
! if no object is found with given instance name.
*/
! void logObject(const std::string &instanceName);
//! Write all Objects to log file.
Index: objecthandlerbase.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/objecthandlerbase.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** objecthandlerbase.cpp 1 Jun 2006 10:52:08 -0000 1.3
--- objecthandlerbase.cpp 1 Jun 2006 13:59:47 -0000 1.4
***************
*** 60,64 ****
i!=objectList_.end(); i++) {
obj_ptr object = i->second;
! out << "Object with handle = " << i->first << ":" << std::endl << *object.get();
}
}
--- 60,64 ----
i!=objectList_.end(); i++) {
obj_ptr object = i->second;
! out << "Object with instanceName = " << i->first << ":" << std::endl << *object.get();
}
}
Index: object.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/oh/object.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** object.hpp 1 Jun 2006 10:52:08 -0000 1.2
--- object.hpp 1 Jun 2006 13:59:47 -0000 1.3
***************
*** 50,54 ****
/*! Construct an Object.
To store the resulting Object in the ObjectHandler, call
! ObjectHandler::instance().storeObject(handle, object);
*/
Object() {};
--- 50,54 ----
/*! Construct an Object.
To store the resulting Object in the ObjectHandler, call
! ObjectHandler::instance().storeObject(instanceName, object);
*/
Object() {};
|