Atlas-C++
Generic.h
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 Erik Ogenvik.
6 // Automatically generated using gen_cpp.py.
7 
8 #ifndef ATLAS_OBJECTS_OPERATION_GENERIC_H
9 #define ATLAS_OBJECTS_OPERATION_GENERIC_H
10 
11 #include <Atlas/Objects/RootOperation.h>
12 #include <Atlas/Objects/SmartPtr.h>
13 
14 namespace Atlas { namespace Objects { namespace Operation {
15 
26 class GenericData;
27 typedef SmartPtr<GenericData> Generic;
28 
29 static const int GENERIC_NO = 41;
30 
33 
40 {
41 protected:
43  GenericData(GenericData *defaults = nullptr) :
45  {
46  m_class_no = GENERIC_NO;
47  }
49  ~GenericData() override = default;
50 
51 public:
53  void setType(const std::string &, int);
54 
56  GenericData * copy() const override;
57 
59  bool instanceOf(int classNo) const override;
60 
61 
62  void iterate(int& current_class, std::string& attr) const override
63  {if(current_class == GENERIC_NO) current_class = -1; RootOperationData::iterate(current_class, attr);}
64 
65 public:
66  template <typename>
67  friend class ::Atlas::Objects::Allocator;
68  static Allocator<GenericData> allocator;
69 
70 protected:
72  void reset() override;
73  void free() override;
74 
75 private:
76 
77  static void fillDefaultObjectInstance(GenericData& data, std::map<std::string, int32_t>& attr_data);
78 };
79 
80 } } } // namespace Atlas::Objects::Operation
81 
82 #endif // ATLAS_OBJECTS_OPERATION_GENERIC_H
bool instanceOf(int classNo) const override
Is this instance of some class?
Base operation for all operators.
Definition: RootOperation.h:41
void setType(const std::string &, int)
Set the type of this object.
Base operation for all operators.
Definition: Generic.h:39
void reset() override
Resets the object as it&#39;s returned to the pool.
void free() override
Free an instance of this class, returning it to the memory pool.
The Atlas namespace.
Definition: Bridge.h:20
void iterate(int &current_class, std::string &attr) const override
Iterate over the attributes of this instance.
GenericData(GenericData *defaults=nullptr)
Construct a GenericData class definition.
Definition: Generic.h:43
void iterate(int &current_class, std::string &attr) const override
Iterate over the attributes of this instance.
Definition: Generic.h:62
Trait which handles allocation of instances of BaseObject.
Definition: BaseObject.h:63
GenericData * copy() const override
Copy this object.
~GenericData() override=default
Default destructor.

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.