19 QObjectMap::const_iterator iter =
fObjectMap.begin();
21 QObject** evData = (iter->second);
44 if(
this == &otherEv)
return *
this;
46 QObjectMap::const_iterator iter = otherEv.
fObjectMap.begin();
50 const QObject* otherEvData = *(iter->second);
52 QObjectMap::iterator thisFound =
fObjectMap.find(label);
58 thisEvData = thisFound->second;
61 else (*thisEvData)->InValidate();
76 QObjectMap::const_iterator iter =
fObjectMap.begin();
78 (*(iter->second))->Reset();
86 QObjectMap::const_iterator iter =
fObjectMap.begin();
89 if((*(iter->second))->IsJustAdded() || (*(iter->second))->IsRequired()) {
90 newMap[iter->first] = iter->second;
100 o<<
"Dump of QEvent read number: "<<
fReadNumber<<
" Caller: \"";
103 QObjectMap::const_iterator iter =
fObjectMap.begin();
110 for(
int i = 0; i < 30+16+30+len; i++) o<<
"-";
115 if(*(iter->second)) evData = *(iter->second);
120 bool isValid =
false;
121 bool isRequired =
false;
122 std::string type =
"n/a";
127 type = evData->ClassName();
138 std::stringstream msgStream;
139 evData->
Dump(msgStream);
141 std::getline(msgStream,line);
143 while(std::getline(msgStream,line)) {
152 o<<
"End of dump of QEvent read number: "<<
fReadNumber<<std::endl;
158 std::vector<QEventLabel> labels;
159 QObjectMap::const_iterator iter =
fObjectMap.begin();
161 labels.push_back(iter->first);
177 QObjectMap::const_iterator iter =
fObjectMap.find(label);
199 if(strcmp(owner,
"") == 0) {
200 std::stringstream msg;
201 msg<<
"Object: "<<name<<
" cannot be added to the event since no owner has been specified ";
206 if(address && address != evData) {
207 std::stringstream msg;
208 msg<<
"Object: "<<label.
GetStringLabel()<<
" is already present in the event";
209 msg<<
": you may want to set the ExtraLabel or OverWriteEvent module options ";
212 (*evData)->SetIsRequired();
#define Q_BEGIN_NAMESPACE
error class with error type and description
label for QObject in the QEvent
std::string GetStringLabel() const
get string in the format "owner@name"
std::string owner
owner of the QObject
std::string name
name of the QObject
std::map< std::string, std::string > fDefaultMap
QObject ** GetObject(const char *owner, const char *name) const
void Clear()
reset members to default values
unsigned int fReadNumber
event number
QObject ** GetObjectByLabel(const QEventLabel &label) const
void Dump(std::ostream &o) const
Print the event and its member.
void Consolidate()
keep only Required and JustAdded QObjects
const std::string mutable * fModuleName
const QEvent & operator=(const QEvent &ev)
operator= new QObject's are created if needed and are owned by this. This this method is protected,...
void GetLabel(const char *owner, const char *name, QEventLabel &label) const
std::vector< QEventLabel > GetLabels() const
Get all object labels.
std::map< QEventLabel, QObject ** > QObjectMap
void Add(WriteHandle< Q > &handle)
Add a QObject to the event.
base class for objects handled by QEvent and QGlobalDataManager.
virtual void Dump(std::ostream &o) const
print content to stream (intended for screen print or log files)
bool IsValid() const
check wheter object is valid
bool IsRequired() const
check wheter this object is required by some module
virtual QObject * Duplicate() const =0
create object of same type, this function is automatically declared/implemented in derived classes by...
void FullyFill(QObject *evData) const
calls Fill(QObject*) if this QObject IsValid(). Copies Validity flag and bits
std::string Resize(const std::string &s, size_t len)
resize a string to len, adding spaces if necessary