Update of /cvsroot/objecthandler/ObjectHandler/ohxl
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17973/ohxl
Modified Files:
callingrange.cpp callingrange.hpp objecthandlerxl.cpp
objecthandlerxl.hpp
Log Message:
cleaner processing for
- permanent objects
- autogeneration of source for loop functions
Index: objecthandlerxl.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** objecthandlerxl.cpp 15 Jun 2006 08:18:36 -0000 1.7
--- objecthandlerxl.cpp 18 Jun 2006 13:41:51 -0000 1.8
***************
*** 108,112 ****
std::string ObjectHandlerXL::storeObject(
! const std::string &instanceName,
const boost::shared_ptr<Object> &object) {
boost::shared_ptr<CallingRange> callingRange = getCallingRange();
--- 108,112 ----
std::string ObjectHandlerXL::storeObject(
! std::string instanceName,
const boost::shared_ptr<Object> &object) {
boost::shared_ptr<CallingRange> callingRange = getCallingRange();
***************
*** 118,133 ****
callingRange->update();
- std::string instanceNameDerived;
if (instanceName.empty()) {
! instanceNameDerived = generateInstanceName();
! object->setAnonymous(true);
! } else {
! instanceNameDerived = instanceName;
}
! callingRange->registerObject(instanceNameDerived, object);
! checkName(instanceNameDerived);
! std::string instanceNameCounter = ObjectHandler::storeObject(instanceNameDerived, object);
return instanceNameCounter + "#" + callingRange->updateCount();
}
--- 118,131 ----
callingRange->update();
if (instanceName.empty()) {
! instanceName = generateInstanceName();
! object->setAnonymous();
}
! callingRange->deleteObject(instanceName, object);
! checkName(instanceName);
! callingRange->registerObject(instanceName, object);
! std::string instanceNameCounter = ObjectHandler::storeObject(instanceName, object);
return instanceNameCounter + "#" + callingRange->updateCount();
}
Index: objecthandlerxl.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/objecthandlerxl.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** objecthandlerxl.hpp 15 Jun 2006 08:18:36 -0000 1.7
--- objecthandlerxl.hpp 18 Jun 2006 13:41:51 -0000 1.8
***************
*** 54,58 ****
Performance in such special cases is sub-optimal.
*/
! virtual std::string storeObject(const std::string &instanceName,
const boost::shared_ptr < Object > &object);
virtual boost::shared_ptr < Object > retrieveObjectImpl(const std::string &instanceName) const;
--- 54,58 ----
Performance in such special cases is sub-optimal.
*/
! virtual std::string storeObject(std::string instanceName,
const boost::shared_ptr < Object > &object);
virtual boost::shared_ptr < Object > retrieveObjectImpl(const std::string &instanceName) const;
Index: callingrange.cpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** callingrange.cpp 15 Jun 2006 08:18:36 -0000 1.4
--- callingrange.cpp 18 Jun 2006 13:41:51 -0000 1.5
***************
*** 84,88 ****
}
! void CallingRange::registerObject(
const std::string &instanceName,
boost::shared_ptr<Object> object) {
--- 84,88 ----
}
! void CallingRange::deleteObject(
const std::string &instanceName,
boost::shared_ptr<Object> object) {
***************
*** 93,96 ****
--- 93,101 ----
residentObjects_.erase(i->first);
}
+ }
+
+ void CallingRange::registerObject(
+ const std::string &instanceName,
+ boost::shared_ptr<Object> object) {
residentObjects_[instanceName] = object;
}
***************
*** 204,217 ****
std::ostream& operator<<(std::ostream& out, const CallingRange &callingRange) {
! out << "name: " << callingRange.key_ << std::endl;
! out << "reference: " << callingRange.getAddressString() << std::endl;
! out << "valid: " << (callingRange.isValid() ? "TRUE" : "FALSE") << std::endl;
! out << "busy: " << (callingRange.busy_ ? "TRUE" : "FALSE") << std::endl;
! out << "update count: " << callingRange.updateCount_ << std::endl;
! out << "invocation count: " << callingRange.invocationCount_ << std::endl;
! out << "resident objects: " << callingRange.residentObjects_.size() << std::endl;
std::map<std::string, boost::shared_ptr<Object> >::const_iterator i;
! for (i = callingRange.residentObjects_.begin(); i != callingRange.residentObjects_.end(); i++)
! out << " instance name: " << i->first << std::endl;
out << std::endl;
return out;
--- 209,234 ----
std::ostream& operator<<(std::ostream& out, const CallingRange &callingRange) {
! static const int COL_WIDTH = 20;
! out << std::setw(COL_WIDTH) << "name: "
! << callingRange.key_ << std::endl;
! out << std::setw(COL_WIDTH) << "reference: "
! << callingRange.getAddressString() << std::endl;
! out << std::setw(COL_WIDTH) << "valid: "
! << std::setiosflags(std::ios_base::boolalpha)
! << callingRange.isValid() << std::endl;
! out << std::setw(COL_WIDTH) << "busy: "
! << std::setiosflags(std::ios_base::boolalpha)
! << callingRange.busy_ << std::endl;
! out << std::setw(COL_WIDTH) << "update count: "
! << callingRange.updateCount_ << std::endl;
! out << std::setw(COL_WIDTH) << "invocation count: "
! << callingRange.invocationCount_ << std::endl;
! out << std::setw(COL_WIDTH) << "resident objects: "
! << callingRange.residentObjects_.size() << std::endl;
std::map<std::string, boost::shared_ptr<Object> >::const_iterator i;
! for (i = callingRange.residentObjects_.begin();
! i != callingRange.residentObjects_.end(); i++)
! out << std::setw(COL_WIDTH) << " instance name: "
! << i->first << std::endl;
out << std::endl;
return out;
Index: callingrange.hpp
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/ohxl/callingrange.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** callingrange.hpp 15 Jun 2006 08:18:36 -0000 1.4
--- callingrange.hpp 18 Jun 2006 13:41:51 -0000 1.5
***************
*** 36,39 ****
--- 36,41 ----
return key_;
}
+ void deleteObject(const std::string &instanceName,
+ boost::shared_ptr<Object> object);
void registerObject(const std::string &instanceName,
boost::shared_ptr<Object> object);
|