32 #ifndef VLXVisitorLinker_INCLUDE_ONCE 33 #define VLXVisitorLinker_INCLUDE_ONCE 68 std::map< std::string,
ref<VLXStructure> >::const_iterator it = mLinkMap->find(uid);
69 if( it != mLinkMap->end() )
75 return it->second.get_writable();
82 Log::error(
Say(
"Could not link ID '%s' to anything!\n") << uid );
93 for(
size_t i=0; i<obj->
value().size(); ++i)
96 obj->
value()[i].value().getStructure()->acceptVisitor(
this);
99 obj->
value()[i].value().getList()->acceptVisitor(
this);
110 obj->
value()[i].value().setStructure( lnk_obj );
120 Log::warning(
"VLXVisitorLinker: cycle detected on VLXList.\n");
124 for(
size_t i=0; i<list->
value().size(); ++i)
127 list->
value()[i].getStructure()->acceptVisitor(
this);
129 list->
value()[i].getList()->acceptVisitor(
this);
140 list->
value()[i].setStructure( lnk_obj );
162 EError
error()
const {
return mError; }
167 const std::map< std::string, ref<VLXStructure> >* mLinkMap;
virtual void visitStructure(VLXStructure *obj)
void setLinkMap(const std::map< std::string, ref< VLXStructure > > *map)
A simple String formatting class.
static void warning(const String &message)
Use this function to provide information about situations that might lead to errors or loss of data...
virtual void visitArray(VLXArrayReal *)
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
An array of 64 bits floating point numbers, can also have a tag.
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
virtual void visitArray(VLXArrayInteger *)
Visualization Library main namespace.
bool isVisited(void *node)
virtual void visitList(VLXList *list)
std::vector< Value > & value()
Base class for all visitors visiting a VLX hierarchy.
An array of 64 bits integers, can also have a tag.
VLXStructure * link(const std::string &uid)
void setError(EError err)
A simple sequence of VLXValue objects, can also have a tag.
Substitutes IDs into VLXStructures using the provided link map.
The ref<> class is used to reference-count an Object.
VLXVisitorLinker(const std::map< std::string, ref< VLXStructure > > *map=NULL)
std::vector< VLXValue > & value()
A list of key/VLXValue pairs, can also have a tag.