78 if(evData) handle.
Set(evData,owner);
94 if(evData) handle.
Set(evData,owner);
106 template<
typename Q>
const Q&
Get(
const char* owner,
const char* name)
const
120 template<
typename Q>
const Q&
Get(
const char* name)
const
140 if(evData) handle.
Set(evData,label.
GetOwner().c_str());
156 std::stringstream msg;
157 msg<<
"Module name not set while getting in write mode a "<<handle.
GetObjectName();
169 template<
typename Q> Q&
Get(
const char* name)
196 std::stringstream msg;
197 msg<<
"Module name not set while adding a "<<handle.
GetObjectName();
201 handle.
Get().SetIsJustAdded();
222 template<
typename Q> Q&
Add(
const std::string& name)
232 template<
typename Q>
void Require(
const std::string& owner,
const std::string& name)
const
235 return RequireByLabel<Q>(label);
247 std::stringstream msg;
252 (*obj)->SetIsRequired();
261 void SetAlias(
const std::string& name,
const std::string& pathInObject,
const std::string& alias)
271 void Dump(std::ostream& o)
const;
279 template<
typename Q>
bool Contains(
const char *owner,
const char *name)
const
282 QObjectMap::const_iterator it =
fObjectMap.find(label);
284 if( (*(it->second))->IsA() == Q::Class() )
290 template<
typename Q>
bool Contains(
const char *label)
const
292 QObjectMap::const_iterator it =
fObjectMap.find(label);
294 if( (*(it->second))->IsA() == Q::Class() )
313 if(evData) handle.
Set(evData,owner);
328 handle.
Set(address,owner);
340 template<
typename Q> Q&
Add(
const char* owner,
const char* name)
360 std::vector<QEventLabel>
GetLabels()
const;
380 void Add(
const char* owner,
const char* name,
QObject**);
#define Q_BEGIN_NAMESPACE
void Add(const QEventLabel &label, const std::string &path, const std::string &alias)
error class with error type and description
Visitor class of QEvent that provides full handling of QEvent.
label for QObject in the QEvent
std::string GetStringLabel() const
get string in the format "owner@name"
const std::string & GetOwner() const
get owner
const std::string & GetName() const
get name
std::string owner
owner of the QObject
std::string name
name of the QObject
std::map< std::string, std::string > fDefaultMap
const Q & GetByLabel(const QEventLabel &label) const
Get a QObject in read mode by label.
const Q & Get(const char *owner, const char *name) const
Get a QObject in read mode.
void SetReadNumber(const unsigned int readNumber)
set the event number as read by the current reader.
void RequireByLabel(const QEventLabel &label) const
notify the QEvent that we need a QObject, if not found an exception is thrown
QObject ** GetObject(const char *owner, const char *name) const
void Clear()
reset members to default values
bool Contains(const char *label) const
Check to see if the event contains a particular object.
Q & Add(const char *owner, const char *name)
Add a QObject to the event. This method has to be called before the event loop.
unsigned int fReadNumber
event number
QObject ** GetObjectByLabel(const QEventLabel &label) const
void Get(const char *owner, WriteHandle< Q > &handle)
Get a QObject handle in write mode.
void Dump(std::ostream &o) const
Print the event and its member.
void Add(const char *owner, WriteHandle< Q > &handle)
Add a QObject to the event. This method has to be called before the event loop.
void Require(const std::string &owner, const std::string &name) const
notify the QEvent that we need a QObject, if not found an exception is thrown
void Consolidate()
keep only Required and JustAdded QObjects
const std::string mutable * fModuleName
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
const QEvent & operator=(const QEvent &ev)
operator= new QObject's are created if needed and are owned by this. This this method is protected,...
Q & Get(const char *name)
Get a QObject in write mode.
void Get(ReadHandle< Q > &handle) const
Get a QObject Handle in read mode, owned by the current module.
void SetOverWrite(const bool ow=true)
set whether an object can be overwritten
const std::string * GetOwner() const
get the name of the module that is currently acting on the event
void GetLabel(const char *owner, const char *name, QEventLabel &label) const
std::vector< QEventLabel > GetLabels() const
Get all object labels.
void SetOwner(const std::string *owner) const
set the name of the module that is currently acting on the event
Q & Add(const std::string &name)
Add a QObject to the event.
std::map< QEventLabel, QObject ** > QObjectMap
unsigned int GetReadNumber() const
return the event number as read by the current reader.
QAliases & GetAliases()
get aliases
void Get(WriteHandle< Q > &handle)
Get a QObject Handle in write mode.
const Q & Get(const char *name) const
Get a QObject in read mode, owned by the current module.
void Add(WriteHandle< Q > &handle)
Add a QObject to the event.
bool Contains(const char *owner, const char *name) const
Check to see if the event contains a particular object.
const QAliases & GetAliases() const
get aliases (const version)
void SetAlias(const std::string &name, const std::string &pathInObject, const std::string &alias)
set alias for objects or variables in objects owned by currentmodule.
std::string GetObjectType() const
get object type
void Set(QObject **address, const char *owner)
set object address (owned by the caller) and owner
const char * GetObjectName() const
get object name
virtual bool Exists() const
Check object validity.
base class for objects handled by QEvent and QGlobalDataManager.
read handle to access QEvent QObject's.
const T & Get() const
Get Object.
write handle to access and add QEvent QObject's.
void CreateObject(const char *owner)
create object
QObject ** GetAddress()
get object address