JANA2
JObject Class Reference
Inheritance diagram for JObject:

Public Member Functions

virtual const std::string className () const
 
void AddAssociatedObject (const JObject *obj)
 
void AddAssociatedObjectAutoDelete (JObject *obj, bool auto_delete=true)
 
void RemoveAssociatedObject (const JObject *obj)
 
void ClearAssociatedObjects (void)
 
bool IsAssociated (const JObject *locObject) const
 
virtual void Summarize (JObjectSummary &summary) const
 

Protected Attributes

std::set< const JObject * > associated
 
std::set< JObject * > auto_delete
 

Member Function Documentation

void JObject::AddAssociatedObject ( const JObject obj)
inline

Add a JObject to the list of associated objects

void JObject::AddAssociatedObjectAutoDelete ( JObject obj,
bool  auto_delete = true 
)
inline

Add a JObject to the list of associated objects. If the auto_delete flag is true, then automatically delete it when this object is deleted. Otherwise, this behaves identically to the AddAssociatedObject method.

Note that if the object is removed via RemoveAssociatedObject(...) then the object is NOT deleted. BUT, if the entire list of associated objects is cleared via ClearAssociatedObjects, then the object will be deleted.

virtual const std::string JObject::className ( void  ) const
inlinevirtual

className returns a string representation of the name of this class. This won't automatically do the right thing – in each JObject subclass, the user either needs to use the JOBJECT_PUBLIC macro, or override this method while keeping the same method body.

void JObject::ClearAssociatedObjects ( void  )
inline

Remove all associated objects from the associated objects list. This will also delete any objects that were added via the AddAssociatedObjectAutoDelete(...) method with the auto_delete flag set.

void JObject::RemoveAssociatedObject ( const JObject obj)
inline

Remove the specified JObject from the list of associated objects. This will NOT delete the object even if the object was added with the AddAssociatedObjectAutoDelete(...) method with the auto_delete flag set.

void JObject::Summarize ( JObjectSummary summary) const
inlinevirtual

A virtual method which allows the user to display the contents of a JObject in a formatted, structured way. This is optional, but recommended.

Fill in the JObjectSummary container with information for each member variable of the JObject using JObjectSummary::add(...). This accepts a reference to the variable itself, the variable name, a printf-style format string, and an optional description string which is good for communicating things like units.

For convenience, we provide a NAME_OF macro, which will turn the member variable name into a string, rather than having the user write it out manually. This is useful if you use automatic refactoring tools, which otherwise might allow the variable name and the stringified name to get out of sync.

References JObjectSummary::add().

Here is the call graph for this function:


The documentation for this class was generated from the following file: