IMP
objects.
The base class for non value-type objects in IMP
. Anything inheriting from IMP::Object has the following properties:
Objects can be outputted to standard streams using operator<<() which will call the Object::show() method.
new
in C++ and passed using pointers and stored using IMP::Pointer objects. Note that you have to be careful of cycles and so must use IMP::WeakPointer objects to break cycles. See IMP::RefCounted for more information on reference counting. IMP_NEW() can help shorten creating a ref counted pointer. See IMP::Pointer for more information. Public Member Functions | |
def | __str__ |
virtual std::string | get_type_name () const =0 |
Return a string identifying the type of the object. | |
virtual VersionInfo | get_version_info () const =0 |
Get information about the module and version of the object. | |
void | set_log_level (LogLevel l) |
Set the logging level used in this object. | |
void | set_was_used (bool tf) const |
void | show (std::ostream &out=std::cout) const |
Print out one or more lines of text describing the object. | |
Names | |
All objects have names to aid in debugging and inspection of the state of the system. These names are not necessarily unique and should not be used to store data or as keys into a table. Use the address of the object instead since objects cannot be copied. | |
const std::string & | get_name () const |
void | set_name (std::string name) |
Friends | |
template<class T > | |
void | IMP::internal::unref (T *) |
void IMP::Object::set_log_level | ( | LogLevel | l | ) |
Set the logging level used in this object.
Each object can be assigned a different log level in order to, for example, suppress messages for verbose and uninteresting objects. If set to DEFAULT, the global level as returned by IMP::get_log_level() is used, otherwise the local one is used. Methods in classes inheriting from Object should start with IMP_OBJECT_LOG to change the log level to the local one for this object and increase the current indent.
void IMP::Object::set_was_used | ( | bool | tf | ) | const |
IMP
provides warnings when objects are never used before they are destroyed. Examples of use include adding an IMP::Restraint to an IMP::Model. If an object is not properly marked as used, or your code is the one using it, call set_was_used(true) on the object.