32 #ifndef VLXVisitorCountIDs_INCLUDE_ONCE 33 #define VLXVisitorCountIDs_INCLUDE_ONCE 52 if(!obj->
uid().empty() && obj->
uid() !=
"#NULL")
53 (*mIDSet)[obj->
uid()]++;
58 for(
size_t i=0; i<obj->
value().size(); ++i)
86 for(
size_t i=0; i<list->
value().size(); ++i)
89 list->
value()[i].getStructure()->acceptVisitor(
this);
91 list->
value()[i].getList()->acceptVisitor(
this);
99 (*mIDSet)[list->
value()[i].getID()]++;
120 void setIDSet(std::map< std::string, int >* uids) { mIDSet = uids; }
122 std::map< std::string, int >*
uidSet() {
return mIDSet; }
124 const std::map< std::string, int >*
uidSet()
const {
return mIDSet; }
127 std::map< std::string, int >* mIDSet;
virtual void visitStructure(VLXStructure *obj)
static void warning(const String &message)
Use this function to provide information about situations that might lead to errors or loss of data...
Counts the number of occurrencies of each ID.
Key/value pair used by VLXStructure.
virtual void visitList(VLXList *list)
An array of 64 bits floating point numbers, can also have a tag.
const std::string & getID() const
virtual void acceptVisitor(Visitor *v)
VLXStructure * getStructure()
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
std::vector< VLXValue > & value()
A list of key/VLXValue pairs, can also have a tag.
std::map< std::string, int > * uidSet()
A simple sequence of VLXValue objects, can also have a tag.
virtual void visitArray(VLXArrayReal *)
virtual void acceptVisitor(Visitor *v)
std::vector< KeyValue > & value()
virtual void visitArray(VLXArrayInteger *)
void setIDSet(std::map< std::string, int > *uids)
An array of 64 bits integers, can also have a tag.
Base class for all visitors visiting a VLX hierarchy.
const std::string & uid() const
const std::map< std::string, int > * uidSet() const
bool isVisited(void *node)