8#include <Atlas/Objects/RootOperation.h>
11using Atlas::Message::MapType;
13namespace Atlas {
namespace Objects {
namespace Operation {
15const std::string SERIALNO_ATTR =
"serialno";
16const std::string REFNO_ATTR =
"refno";
17const std::string FROM_ATTR =
"from";
18const std::string TO_ATTR =
"to";
19const std::string SECONDS_ATTR =
"seconds";
20const std::string FUTURE_SECONDS_ATTR =
"future_seconds";
21const std::string ARGS_ATTR =
"args";
25 if (allocator.attr_flags_Data.find(name) != allocator.attr_flags_Data.end()) {
26 return ROOT_OPERATION_NO;
33 auto I = allocator.attr_flags_Data.find(name);
34 if (I != allocator.attr_flags_Data.end()) {
43 if (name == SERIALNO_ATTR) { attr =
getSerialno();
return 0; }
44 if (name == REFNO_ATTR) { attr =
getRefno();
return 0; }
45 if (name == FROM_ATTR) { attr =
getFrom();
return 0; }
46 if (name == TO_ATTR) { attr =
getTo();
return 0; }
47 if (name == SECONDS_ATTR) { attr =
getSeconds();
return 0; }
67 if (name == SERIALNO_ATTR)
68 { m_attrFlags &= ~SERIALNO_FLAG;
return;}
69 if (name == REFNO_ATTR)
70 { m_attrFlags &= ~REFNO_FLAG;
return;}
71 if (name == FROM_ATTR)
72 { m_attrFlags &= ~FROM_FLAG;
return;}
74 { m_attrFlags &= ~TO_FLAG;
return;}
75 if (name == SECONDS_ATTR)
76 { m_attrFlags &= ~SECONDS_FLAG;
return;}
77 if (name == FUTURE_SECONDS_ATTR)
78 { m_attrFlags &= ~FUTURE_SECONDS_FLAG;
return;}
79 if (name == ARGS_ATTR)
80 { m_attrFlags &= ~ARGS_FLAG;
return;}
86 if(m_attrFlags & SERIALNO_FLAG) {
93 if(m_attrFlags & REFNO_FLAG) {
100 if(m_attrFlags & FROM_FLAG) {
107 if(m_attrFlags & TO_FLAG) {
108 b.mapStringItem(TO_ATTR,
attr_to);
114 if(m_attrFlags & SECONDS_FLAG) {
121 if(m_attrFlags & FUTURE_SECONDS_FLAG) {
128 if(m_attrFlags & ARGS_FLAG) {
129 b.mapListItem(ARGS_ATTR);
132 item->sendContents(b);
154 if(m_attrFlags & SERIALNO_FLAG)
156 if(m_attrFlags & REFNO_FLAG)
158 if(m_attrFlags & FROM_FLAG)
160 if(m_attrFlags & TO_FLAG)
162 if(m_attrFlags & SECONDS_FLAG)
164 if(m_attrFlags & FUTURE_SECONDS_FLAG)
166 if(m_attrFlags & ARGS_FLAG)
176 allocator.free(
this);
189 return copyInstance<RootOperationData>(*
this);
194 if(ROOT_OPERATION_NO == classNo)
return true;
198void RootOperationData::fillDefaultObjectInstance(
RootOperationData& data, std::map<std::string, uint32_t>& attr_data)
207 attr_data[SERIALNO_ATTR] = SERIALNO_FLAG;
208 attr_data[REFNO_ATTR] = REFNO_FLAG;
209 attr_data[FROM_ATTR] = FROM_FLAG;
210 attr_data[TO_ATTR] = TO_FLAG;
211 attr_data[SECONDS_ATTR] = SECONDS_FLAG;
212 attr_data[FUTURE_SECONDS_ATTR] = FUTURE_SECONDS_FLAG;
213 attr_data[ARGS_ATTR] = ARGS_FLAG;
StringType && moveString()
FloatType asFloat() const
Retrieve the current value as a double.
IntType asInt() const
Retrieve the current value as a int.
Base operation for all operators.
void setFrom(std::string val)
Set the "from" attribute.
void setTo(std::string val)
Set the "to" attribute.
std::string attr_from
Source of message/operation.
int copyAttr(const std::string &name, Atlas::Message::Element &attr) const override
bool instanceOf(int classNo) const override
Is this instance of some class?
const std::string & getFrom() const
Retrieve the "from" attribute.
std::vector< Root > attr_args
List of arguments this operation has.
void sendFutureSeconds(Atlas::Bridge &) const
Send the "future_seconds" attribute to an Atlas::Bridge.
std::int64_t getRefno() const
Retrieve the "refno" attribute.
void sendTo(Atlas::Bridge &) const
Send the "to" attribute to an Atlas::Bridge.
bool getAttrFlag(const std::string &name, uint32_t &flag) const override
Find the flag for the attribute "name".
double getSeconds() const
Retrieve the "seconds" attribute.
const std::string & getTo() const
Retrieve the "to" attribute.
void setSerialno(std::int64_t val)
Set the "serialno" attribute.
Atlas::Message::ListType getArgsAsList() const
Retrieve the "args" attribute AsList.
double attr_future_seconds
Time in seconds to add current time.
void free() override
Free an instance of this class, returning it to the memory pool.
int getAttrClass(const std::string &name) const override
Find the class which contains the attribute "name".
void sendFrom(Atlas::Bridge &) const
Send the "from" attribute to an Atlas::Bridge.
RootOperationData * copy() const override
Copy this object.
void setSeconds(double val)
Set the "seconds" attribute.
void setRefno(std::int64_t val)
Set the "refno" attribute.
void sendContents(Atlas::Bridge &b) const override
Send the contents of this object to a Bridge.
void sendSerialno(Atlas::Bridge &) const
Send the "serialno" attribute to an Atlas::Bridge.
void setFutureSeconds(double val)
Set the "future_seconds" attribute.
void sendRefno(Atlas::Bridge &) const
Send the "refno" attribute to an Atlas::Bridge.
double attr_seconds
Time in seconds.
void reset() override
Resets the object as it's returned to the pool.
void removeAttr(const std::string &name) override
Remove the attribute "name". This will not work for static attributes.
double getFutureSeconds() const
Retrieve the "future_seconds" attribute.
std::int64_t attr_refno
Reference to serial number.
void setAttr(std::string name, Atlas::Message::Element attr, const Atlas::Objects::Factories *factories=nullptr) override
Set the attribute "name" to the value given by"attr".
std::string attr_to
Target of message/operation.
void setArgsAsList(const Atlas::Message::ListType &val, const Atlas::Objects::Factories *factories)
Set the "args" attribute AsList.
std::int64_t getSerialno() const
Retrieve the "serialno" attribute.
void addToMessage(Atlas::Message::MapType &) const override
Write this object to an existing Element.
void sendArgs(Atlas::Bridge &) const
Send the "args" attribute to an Atlas::Bridge.
std::int64_t attr_serialno
Serial number.
void sendSeconds(Atlas::Bridge &) const
Send the "seconds" attribute to an Atlas::Bridge.
std::string attr_objtype
What kind of object this is.
void reset() override
Resets the object as it's returned to the pool.
std::string attr_parent
The object this inherits attributes from.
int copyAttr(const std::string &name, Atlas::Message::Element &attr) const override
double attr_stamp
Last time this object was modified.
bool getAttrFlag(const std::string &name, uint32_t &flag) const override
Find the flag for the attribute "name".
void addToMessage(Atlas::Message::MapType &) const override
Write this object to an existing Element.
bool instanceOf(int classNo) const override
Is this instance of some class?
void setAttr(std::string name, Atlas::Message::Element attr, const Atlas::Objects::Factories *factories=nullptr) override
Set the attribute "name" to the value given by"attr".
int getAttrClass(const std::string &name) const override
Find the class which contains the attribute "name".
void removeAttr(const std::string &name) override
Remove the attribute "name". This will not work for static attributes.
void sendContents(Atlas::Bridge &b) const override
Send the contents of this object to a Bridge.