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
void sendFrom(Atlas::Bridge &) const
Send the "from" attribute to an Atlas::Bridge.
virtual void setAttr(const std::string &name, const Atlas::Message::Element &attr)
Set the attribute "name" to the value given by"attr".
void setSerialno(long val)
Set the "serialno" attribute.
Definition: RootOperation.h:218
double getSeconds() const
Retrieve the "seconds" attribute.
Definition: RootOperation.h:354
void setFrom(const std::string &val)
Set the "from" attribute.
Definition: RootOperation.h:234
void setRefno(long val)
Set the "refno" attribute.
Definition: RootOperation.h:226
All objects inherit from this.
Definition: Root.h:35
void sendTo(Atlas::Bridge &) const
Send the "to" attribute to an Atlas::Bridge.
virtual bool instanceOf(int classNo) const
Is this instance of some class?
Atlas stream bridge.
Definition: Bridge.h:35
bool isDefaultFutureSeconds() const
Is "future_seconds" value default?
Definition: RootOperation.h:438
void sendSerialno(Atlas::Bridge &) const
Send the "serialno" attribute to an Atlas::Bridge.
long getSerialno() const
Retrieve the "serialno" attribute.
Definition: RootOperation.h:294
void setSeconds(double val)
Set the "seconds" attribute.
Definition: RootOperation.h:250
virtual void removeAttr(const std::string &name)
Remove the attribute "name". This will not work for static attributes.
static RootOperationData * getDefaultObjectInstance()
Get the reference object that contains the default values for attributes of instances of this class.
const std::string & getTo() const
Retrieve the "to" attribute.
Definition: RootOperation.h:339
long attr_serialno
Serial number.
Definition: RootOperation.h:146
virtual RootOperationData * getDefaultObject()
Get the reference object that contains the default values for attributes of instances of the same cla...
void setArgs1(const SmartPtr< ObjectData > &val)
Set the first member of "args".
Definition: RootOperation.h:287
void setArgs(const std::vector< Root > &val)
Set the "args" attribute.
Definition: RootOperation.h:266
double getFutureSeconds() const
Retrieve the "future_seconds" attribute.
Definition: RootOperation.h:369
std::vector< Root > attr_args
List of arguments this operation has.
Definition: RootOperation.h:158
virtual int getAttrFlag(const std::string &name) const
Find the flag for the attribute "name".
std::string & modifyFrom()
Retrieve the "from" attribute as a non-const reference.
Definition: RootOperation.h:332
virtual int getAttrClass(const std::string &name) const
Find the class which contains the attribute "name".
void sendArgs(Atlas::Bridge &) const
Send the "args" attribute to an Atlas::Bridge.
const Atlas::Message::ListType getArgsAsList() const
Retrieve the "args" attribute AsList.
Definition: RootOperation.h:399
RootOperationData(RootOperationData *defaults=NULL)
Construct a RootOperationData class definition.
Definition: RootOperation.h:44
long attr_refno
Reference to serial number.
Definition: RootOperation.h:148
bool isDefaultRefno() const
Is "refno" value default?
Definition: RootOperation.h:418
std::string attr_to
Target of message/operation.
Definition: RootOperation.h:152
virtual ~RootOperationData()
Default destructor.
Multi-type container.
Definition: Element.h:60
bool isDefaultTo() const
Is "to" value default?
Definition: RootOperation.h:428
double attr_seconds
Time in seconds.
Definition: RootOperation.h:154
virtual RootOperationData * copy() const
Copy this object.
void setArgsAsList(const Atlas::Message::ListType &val)
Set the "args" attribute AsList.
Definition: RootOperation.h:272
std::string attr_from
Source of message/operation.
Definition: RootOperation.h:150
void sendRefno(Atlas::Bridge &) const
Send the "refno" attribute to an Atlas::Bridge.
long getRefno() const
Retrieve the "refno" attribute.
Definition: RootOperation.h:309
virtual void addToMessage(Atlas::Message::MapType &) const
Write this object to an existing Element.
double & modifySeconds()
Retrieve the "seconds" attribute as a non-const reference.
Definition: RootOperation.h:362
std::string & modifyTo()
Retrieve the "to" attribute as a non-const reference.
Definition: RootOperation.h:347
const std::vector< Root > & getArgs() const
Retrieve the "args" attribute.
Definition: RootOperation.h:384
long & modifyRefno()
Retrieve the "refno" attribute as a non-const reference.
Definition: RootOperation.h:317
Base operation for all operators.
Definition: RootOperation.h:40
void sendFutureSeconds(Atlas::Bridge &) const
Send the "future_seconds" attribute to an Atlas::Bridge.
bool isDefaultFrom() const
Is "from" value default?
Definition: RootOperation.h:423
long & modifySerialno()
Retrieve the "serialno" attribute as a non-const reference.
Definition: RootOperation.h:302
double & modifyFutureSeconds()
Retrieve the "future_seconds" attribute as a non-const reference.
Definition: RootOperation.h:377
double attr_future_seconds
Time in seconds to add current time.
Definition: RootOperation.h:156
bool isDefaultArgs() const
Is "args" value default?
Definition: RootOperation.h:443
virtual void sendContents(Atlas::Bridge &b) const
Send the contents of this object to a Bridge.
virtual void iterate(int ¤t_class, std::string &attr) const
Iterate over the attributes of this instance.
The Atlas namespace.
Definition: Bridge.h:20
std::vector< Root > & modifyArgs()
Retrieve the "args" attribute as a non-const reference.
Definition: RootOperation.h:392
bool isDefaultSerialno() const
Is "serialno" value default?
Definition: RootOperation.h:413
void setFutureSeconds(double val)
Set the "future_seconds" attribute.
Definition: RootOperation.h:258
virtual void free()
Free an instance of this class, returning it to the memory pool.
virtual int copyAttr(const std::string &name, Atlas::Message::Element &attr) const
Retrieve the attribute "name".
bool isDefaultSeconds() const
Is "seconds" value default?
Definition: RootOperation.h:433
void setTo(const std::string &val)
Set the "to" attribute.
Definition: RootOperation.h:242
void sendSeconds(Atlas::Bridge &) const
Send the "seconds" attribute to an Atlas::Bridge.
const std::string & getFrom() const
Retrieve the "from" attribute.
Definition: RootOperation.h:324
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.