7 #ifndef ATLAS_OBJECTS_OPERATION_ROOTOPERATION_H 8 #define ATLAS_OBJECTS_OPERATION_ROOTOPERATION_H 10 #include <Atlas/Objects/Root.h> 11 #include <Atlas/Objects/SmartPtr.h> 13 #include <Atlas/Objects/objectFactory.h> 15 namespace Atlas {
namespace Objects {
namespace Operation {
27 class RootOperationData;
28 typedef SmartPtr<RootOperationData> RootOperation;
30 static const int ROOT_OPERATION_NO = 9;
47 m_class_no = ROOT_OPERATION_NO;
63 virtual void setAttr(
const std::string& name,
66 virtual void removeAttr(
const std::string& name);
72 virtual void addToMessage(Atlas::Message::MapType &)
const;
79 inline void setFrom(
const std::string& val);
81 inline void setTo(
const std::string& val);
87 inline void setArgs(
const std::vector<Root>& val);
89 inline void setArgsAsList(
const Atlas::Message::ListType& val);
91 template <
class ObjectData>
103 inline const std::string&
getFrom()
const;
107 inline const std::string&
getTo()
const;
119 inline const std::vector<Root>&
getArgs()
const;
144 virtual int getAttrFlag(
const std::string& name)
const;
175 virtual void iterate(
int& current_class, std::string& attr)
const;
197 static std::map<std::string, int> * attr_flags_RootOperationData;
204 extern const std::string SERIALNO_ATTR;
205 extern const std::string REFNO_ATTR;
206 extern const std::string FROM_ATTR;
207 extern const std::string TO_ATTR;
208 extern const std::string SECONDS_ATTR;
209 extern const std::string FUTURE_SECONDS_ATTR;
210 extern const std::string ARGS_ATTR;
216 const int SERIALNO_FLAG = 1 << 14;
221 m_attrFlags |= SERIALNO_FLAG;
224 const int REFNO_FLAG = 1 << 15;
229 m_attrFlags |= REFNO_FLAG;
232 const int FROM_FLAG = 1 << 16;
237 m_attrFlags |= FROM_FLAG;
240 const int TO_FLAG = 1 << 17;
245 m_attrFlags |= TO_FLAG;
248 const int SECONDS_FLAG = 1 << 18;
253 m_attrFlags |= SECONDS_FLAG;
256 const int FUTURE_SECONDS_FLAG = 1 << 19;
261 m_attrFlags |= FUTURE_SECONDS_FLAG;
264 const int ARGS_FLAG = 1 << 20;
269 m_attrFlags |= ARGS_FLAG;
274 m_attrFlags |= ARGS_FLAG;
276 for(Message::ListType::const_iterator I = val.begin();
281 attr_args.push_back(Factories::instance()->createObject(I->asMap()));
286 template <
class ObjectData>
289 m_attrFlags |= ARGS_FLAG;
296 if(m_attrFlags & SERIALNO_FLAG)
304 if(!(m_attrFlags & SERIALNO_FLAG))
311 if(m_attrFlags & REFNO_FLAG)
319 if(!(m_attrFlags & REFNO_FLAG))
326 if(m_attrFlags & FROM_FLAG)
334 if(!(m_attrFlags & FROM_FLAG))
341 if(m_attrFlags & TO_FLAG)
349 if(!(m_attrFlags & TO_FLAG))
356 if(m_attrFlags & SECONDS_FLAG)
364 if(!(m_attrFlags & SECONDS_FLAG))
371 if(m_attrFlags & FUTURE_SECONDS_FLAG)
379 if(!(m_attrFlags & FUTURE_SECONDS_FLAG))
386 if(m_attrFlags & ARGS_FLAG)
394 if(!(m_attrFlags & ARGS_FLAG))
401 const std::vector<Root>& args_in =
getArgs();
402 Atlas::Message::ListType args_out;
403 for(std::vector<Root>::const_iterator I = args_in.begin();
407 args_out.push_back(Atlas::Message::MapType());
408 (*I)->addToMessage(args_out.back().asMap());
415 return (m_attrFlags & SERIALNO_FLAG) == 0;
420 return (m_attrFlags & REFNO_FLAG) == 0;
425 return (m_attrFlags & FROM_FLAG) == 0;
430 return (m_attrFlags & TO_FLAG) == 0;
435 return (m_attrFlags & SECONDS_FLAG) == 0;
440 return (m_attrFlags & FUTURE_SECONDS_FLAG) == 0;
445 return (m_attrFlags & ARGS_FLAG) == 0;
451 #endif // ATLAS_OBJECTS_OPERATION_ROOTOPERATION_H long attr_refno
Reference to serial number.
Definition: RootOperation.h:148
double & modifyFutureSeconds()
Retrieve the "future_seconds" attribute as a non-const reference.
Definition: RootOperation.h:377
void setArgs(const std::vector< Root > &val)
Set the "args" attribute.
Definition: RootOperation.h:266
virtual void addToMessage(Atlas::Message::MapType &) const
Write this object to an existing Element.
long getRefno() const
Retrieve the "refno" attribute.
Definition: RootOperation.h:309
void setSeconds(double val)
Set the "seconds" attribute.
Definition: RootOperation.h:250
bool isDefaultFrom() const
Is "from" value default?
Definition: RootOperation.h:423
const std::vector< Root > & getArgs() const
Retrieve the "args" attribute.
Definition: RootOperation.h:384
std::string attr_from
Source of message/operation.
Definition: RootOperation.h:150
std::string & modifyTo()
Retrieve the "to" attribute as a non-const reference.
Definition: RootOperation.h:347
Base operation for all operators.
Definition: RootOperation.h:40
void setArgs1(const SmartPtr< ObjectData > &val)
Set the first member of "args".
Definition: RootOperation.h:287
virtual void free()
Free an instance of this class, returning it to the memory pool.
Atlas stream bridge.
Definition: Bridge.h:35
long & modifyRefno()
Retrieve the "refno" attribute as a non-const reference.
Definition: RootOperation.h:317
std::vector< Root > & modifyArgs()
Retrieve the "args" attribute as a non-const reference.
Definition: RootOperation.h:392
void setTo(const std::string &val)
Set the "to" attribute.
Definition: RootOperation.h:242
virtual RootOperationData * getDefaultObject()
Get the reference object that contains the default values for attributes of instances of the same cla...
double getFutureSeconds() const
Retrieve the "future_seconds" attribute.
Definition: RootOperation.h:369
virtual int getAttrClass(const std::string &name) const
Find the class which contains the attribute "name".
double attr_future_seconds
Time in seconds to add current time.
Definition: RootOperation.h:156
void setFutureSeconds(double val)
Set the "future_seconds" attribute.
Definition: RootOperation.h:258
void sendSeconds(Atlas::Bridge &) const
Send the "seconds" attribute to an Atlas::Bridge.
virtual void sendContents(Atlas::Bridge &b) const
Send the contents of this object to a Bridge.
Multi-type container.
Definition: Element.h:60
std::string & modifyFrom()
Retrieve the "from" attribute as a non-const reference.
Definition: RootOperation.h:332
bool isDefaultRefno() const
Is "refno" value default?
Definition: RootOperation.h:418
void setArgsAsList(const Atlas::Message::ListType &val)
Set the "args" attribute AsList.
Definition: RootOperation.h:272
virtual void iterate(int ¤t_class, std::string &attr) const
Iterate over the attributes of this instance.
std::vector< Root > attr_args
List of arguments this operation has.
Definition: RootOperation.h:158
void setFrom(const std::string &val)
Set the "from" attribute.
Definition: RootOperation.h:234
double & modifySeconds()
Retrieve the "seconds" attribute as a non-const reference.
Definition: RootOperation.h:362
void setSerialno(long val)
Set the "serialno" attribute.
Definition: RootOperation.h:218
long attr_serialno
Serial number.
Definition: RootOperation.h:146
long & modifySerialno()
Retrieve the "serialno" attribute as a non-const reference.
Definition: RootOperation.h:302
RootOperationData(RootOperationData *defaults=NULL)
Construct a RootOperationData class definition.
Definition: RootOperation.h:44
The Atlas namespace.
Definition: Bridge.h:20
All objects inherit from this.
Definition: Root.h:35
bool isDefaultTo() const
Is "to" value default?
Definition: RootOperation.h:428
void sendTo(Atlas::Bridge &) const
Send the "to" attribute to an Atlas::Bridge.
const Atlas::Message::ListType getArgsAsList() const
Retrieve the "args" attribute AsList.
Definition: RootOperation.h:399
static RootOperationData * getDefaultObjectInstance()
Get the reference object that contains the default values for attributes of instances of this class...
void sendArgs(Atlas::Bridge &) const
Send the "args" attribute to an Atlas::Bridge.
double attr_seconds
Time in seconds.
Definition: RootOperation.h:154
double getSeconds() const
Retrieve the "seconds" attribute.
Definition: RootOperation.h:354
void sendFrom(Atlas::Bridge &) const
Send the "from" attribute to an Atlas::Bridge.
virtual void removeAttr(const std::string &name)
Remove the attribute "name". This will not work for static attributes.
virtual int getAttrFlag(const std::string &name) const
Find the flag for the attribute "name".
virtual int copyAttr(const std::string &name, Atlas::Message::Element &attr) const
Retrieve the attribute "name".
void sendFutureSeconds(Atlas::Bridge &) const
Send the "future_seconds" attribute to an Atlas::Bridge.
bool isDefaultSeconds() const
Is "seconds" value default?
Definition: RootOperation.h:433
const std::string & getFrom() const
Retrieve the "from" attribute.
Definition: RootOperation.h:324
virtual void setAttr(const std::string &name, const Atlas::Message::Element &attr)
Set the attribute "name" to the value given by"attr".
void sendSerialno(Atlas::Bridge &) const
Send the "serialno" attribute to an Atlas::Bridge.
bool isDefaultFutureSeconds() const
Is "future_seconds" value default?
Definition: RootOperation.h:438
void setRefno(long val)
Set the "refno" attribute.
Definition: RootOperation.h:226
const std::string & getTo() const
Retrieve the "to" attribute.
Definition: RootOperation.h:339
std::string attr_to
Target of message/operation.
Definition: RootOperation.h:152
long getSerialno() const
Retrieve the "serialno" attribute.
Definition: RootOperation.h:294
virtual ~RootOperationData()
Default destructor.
bool isDefaultArgs() const
Is "args" value default?
Definition: RootOperation.h:443
virtual bool instanceOf(int classNo) const
Is this instance of some class?
bool isDefaultSerialno() const
Is "serialno" value default?
Definition: RootOperation.h:413
void sendRefno(Atlas::Bridge &) const
Send the "refno" attribute to an Atlas::Bridge.
virtual RootOperationData * copy() const
Copy this object.