| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ObjectReg.cc

Go to the documentation of this file.
00001 #include "DybKernel/ObjectReg.h"
00002 
00003 const DataObject* ObjectReg::object() const 
00004 {
00005   return m_object;
00006 }
00007 DataObject* ObjectReg::object()
00008 {
00009   return m_object;
00010 }
00011 
00012 bool ObjectReg::store() const 
00013 {
00014   return m_store;
00015 }
00016 
00017 void ObjectReg::setStore(bool value) 
00018 {
00019   m_store = value;
00020 }
00021 
00022 ObjectReg::ObjectReg(IRegistry* registry,
00023                      DataObject* object,
00024                      bool store):
00025   m_registry(0),
00026   m_object(0),
00027   m_store(store)
00028 {
00029   setRegistry(registry);
00030   setObject(object);
00031 }
00032 
00033 ObjectReg::ObjectReg(const ObjectReg& rhs) :
00034   m_registry(0),
00035   m_object(0),
00036   m_store(rhs.m_store)
00037 {
00038   setRegistry(rhs.m_registry);
00039   setObject(rhs.m_object);
00040 }
00041 
00042 ObjectReg::~ObjectReg() 
00043 {
00044   if (m_registry) {
00045     m_registry->release();
00046   }
00047   if (0 != m_object) {
00048     m_object->release();
00049   }          
00050 }
00051 
00052 const std::string& ObjectReg::path() const 
00053 {
00054   return m_registry->identifier();
00055 }
00056 
00057 const IRegistry* ObjectReg::registry() const
00058 {
00059     return m_registry;
00060 }
00061 
00062 void ObjectReg::setObject(DataObject* value) 
00063 {
00064   if (value == m_object) {
00065     return;
00066   }
00067 
00068   if (0 != value) {
00069     value->addRef();
00070   }
00071 
00072   if (0 != m_object) {
00073     m_object->release();
00074   }
00075   m_object = value;
00076 }
00077 
00078 void ObjectReg::setRegistry(IRegistry* registry) 
00079 {
00080   if (registry == m_registry) {
00081     return;
00082   }
00083 
00084   if (0 != registry) {
00085     registry->addRef();
00086   }
00087 
00088   if (0 != m_registry) {
00089     m_registry->release();
00090   }
00091   m_registry = registry;
00092 }
00093 
00094 int ObjectReg::entry() const
00095 {
00096   return m_entry;
00097 }
00098 void ObjectReg::setEntry(int entry)
00099 {
00100   m_entry = entry;
00101 }
00102 
00103 ObjectReg& ObjectReg::operator=(const ObjectReg& rhs) {
00104   if (this != &rhs) {
00105     setRegistry(rhs.m_registry);
00106     setObject(rhs.m_object);
00107     m_store=rhs.m_store;
00108   }
00109   return *this;
00110 }
00111 
00112 // Local Variables:
00113 // c-basic-offset: 2
00114 // End:
00115 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:09:25 2011 for DybKernel by doxygen 1.4.7