Atlas  0.7.0
Networking protocol for the Worldforge system.
Generic.cpp
1 // This file may be redistributed and modified only under the terms of
2 // the GNU Lesser General Public License (See COPYING for details).
3 // Copyright 2000-2001 Stefanus Du Toit and Aloril.
4 // Copyright 2001-2005 Alistair Riddoch.
5 // Copyright 2011-2020 Erik Ogenvik.
6 // Automatically generated using gen_cpp.py. Don't edit directly.
7 
8 #include <Atlas/Objects/Generic.h>
9 
11 using Atlas::Message::MapType;
12 
13 namespace Atlas { namespace Objects { namespace Operation {
14 
15 Allocator<GenericData> GenericData::allocator;
16 
17 
18 
20 {
21  allocator.free(this);
22 }
23 
24 
25 
27 {
29 }
30 
31 void GenericData::setType(const std::string & name, int no)
32 {
33  setParent(name);
34  m_class_no = no;
35 }
36 
38 {
39  return copyInstance<GenericData>(*this);
40 }
41 
42 bool GenericData::instanceOf(int classNo) const
43 {
44  if(GENERIC_NO == classNo) return true;
45  return RootOperationData::instanceOf(classNo);
46 }
47 
48 void GenericData::fillDefaultObjectInstance(GenericData& data, std::map<std::string, uint32_t>& attr_data)
49 {
50  data.attr_objtype = default_objtype;
51  data.attr_serialno = 0;
52  data.attr_refno = 0;
53  data.attr_seconds = 0.0;
54  data.attr_future_seconds = 0.0;
55  data.attr_stamp = 0.0;
56 }
57 
58 } } } // namespace Atlas::Objects::Operation
Base operation for all operators.
Definition: Generic.h:40
bool instanceOf(int classNo) const override
Is this instance of some class?
Definition: Generic.cpp:42
void setType(const std::string &, int)
Set the type of this object.
Definition: Generic.cpp:31
void free() override
Free an instance of this class, returning it to the memory pool.
Definition: Generic.cpp:19
GenericData * copy() const override
Copy this object.
Definition: Generic.cpp:37
void reset() override
Resets the object as it's returned to the pool.
Definition: Generic.cpp:26
bool instanceOf(int classNo) const override
Is this instance of some class?
double attr_future_seconds
Time in seconds to add current time.
void reset() override
Resets the object as it's returned to the pool.
std::int64_t attr_refno
Reference to serial number.
std::int64_t attr_serialno
Serial number.
std::string attr_objtype
What kind of object this is.
Definition: Root.h:129
void setParent(std::string val)
Set the "parent" attribute.
Definition: Root.h:183
double attr_stamp
Last time this object was modified.
Definition: Root.h:127
Definition: Bridge.h:21