33 #include "hurricane/Error.h"
34 #include "hurricane/DBos.h"
35 #include "hurricane/Name.h"
36 #include "hurricane/Properties.h"
47 enum DBoFlags { ForcedIdMode = (1<<0)
51 static void setMemoryLimit (
unsigned int );
52 static void setIdCounterLimit (
unsigned int );
53 static unsigned int getIdCounter ();
54 unsigned int getNextId ();
55 static void setNextId (
unsigned int );
56 static void resetId ();
57 static bool inForcedIdMode ();
58 static void enableForcedIdMode ();
59 static void disableForcedIdMode ();
60 static void useIdCounter2 ();
63 inline set<Property*>& _getPropertySet ();
64 void _onDestroyed (
Property* property );
65 inline unsigned int getId ()
const;
69 void setId (
unsigned int );
74 virtual string _getTypeName ()
const;
75 virtual string _getString ()
const;
76 virtual Record* _getRecord ()
const;
77 virtual void _toJson ( JsonWriter* )
const;
78 virtual void _toJsonCollections ( JsonWriter* )
const;
79 virtual void _toJsonSignature ( JsonWriter* )
const;
80 void toJson ( JsonWriter* )
const;
81 void toJsonSignature ( JsonWriter* )
const;
84 virtual ~
DBo () noexcept(false);
85 virtual
void _postCreate ();
86 virtual
void _preDestroy ();
88 DBo ( const
DBo& ) = delete;
89 DBo& operator= ( const
DBo& ) = delete;
91 static
unsigned int _memoryLimit;
92 static
unsigned long _flags;
93 static
unsigned int _nextId;
94 static
unsigned int _idCount;
95 static
unsigned int _idCounter;
96 static
unsigned int _idCounterLimit;
100 struct CompareById : public std::binary_function<const
DBo*,const
DBo*,
bool> {
101 template<
typename Key>
102 inline bool operator() (
const Key* lhs,
const Key* rhs )
const;
108 inline set<Property*>& DBo::_getPropertySet () {
return _propertySet; }
110 inline unsigned int DBo::getId ()
const {
return _id; }
112 template<
typename Key>
113 inline bool DBo::CompareById::operator() (
const Key* lhs,
const Key* rhs )
const
114 {
return ((lhs)?lhs->getId():0) < ((rhs)?rhs->getId():0); }
120 class JsonDBo :
public JsonObject {
122 JsonDBo (
unsigned int flags );
123 template<
typename T>
inline void update ( JsonStack&, T );
127 template<
typename T>
inline void JsonDBo::update ( JsonStack& stack, T hobject )
129 JsonObject::update<T>( stack, hobject );
130 stack.push_back_dbo(
dynamic_cast<DBo*
>(hobject) );
DataBase object root class (API).
Definition: DBo.h:45
bool hasProperty() const
Definition: DBo.h:109
Property * getProperty(const Name &) const
void removeProperty(const Name &)
Properties getProperties() const
Generic Collection auto-pointer.
Definition: Collection.h:235
Name description (API)
Definition: Name.h:35
Property description (API)
Definition: Property.h:56
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5