OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
OTObject.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
11
12// std header
13#include <list>
14#include <string>
15
16namespace ot {
17
21 public:
22 OTObject(OTObject* _parentObject = (OTObject*)nullptr);
23 virtual ~OTObject();
24
25 void setParentOTObject(OTObject* _newParent);
26 OTObject* getParentOTObject(void) { return m_parentObject; };
27 const OTObject* getParentOTObject(void) const { return m_parentObject; };
28
29 void registerDeleteNotifier(OTObject* _notifier);
30 void removeDeleteNotifier(OTObject* _notifier);
31
32 const std::list<OTObject*>& getChildOTObjects(void) const { return m_childObjects; };
33 OTObject* findChildOTObject(const std::string& _objectName);
34 const OTObject* findChildOTObject(const std::string& _objectName) const;
35
36 void setOTObjectName(const std::string& _name) { m_name = _name; };
37 const std::string& getOTObjectName(void) const { return m_name; };
38
39 protected:
40 virtual void objectWasDestroyed(OTObject* _object) {};
41
42 private:
43 void registerChildObject(OTObject* _object);
44 void forgetChildObject(OTObject* _object);
45 void forgetObject(OTObject* _object);
46
47 std::string m_name;
48
49 OTObject* m_parentObject;
50
51 std::list<OTObject*> m_deleteNotifier;
52 std::list<OTObject*> m_watchedObjects;
53 std::list<OTObject*> m_childObjects;
54 };
55
56}
#define OT_CORE_API_EXPORT
Dll import.
Definition CoreAPIExport.h:8
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOMOVE(___class)
Removes the default move constructor and move operator.
Definition OTClassHelper.h:18
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
Definition OTObject.h:18
virtual void objectWasDestroyed(OTObject *_object)
Definition OTObject.h:40
const OTObject * getParentOTObject(void) const
Definition OTObject.h:27
const std::string & getOTObjectName(void) const
Definition OTObject.h:37
void setOTObjectName(const std::string &_name)
Definition OTObject.h:36
OTObject * getParentOTObject(void)
Definition OTObject.h:26
const std::list< OTObject * > & getChildOTObjects(void) const
Definition OTObject.h:32
Definition Connector.h:8