The Vish Visualization Shell 0.3
Vish
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Wizt::VManagedObject Class Referenceabstract

Common class for all objects that may be created through the database. More...

#include <ocean/plankton/VManagedObject.hpp>

Inheritance diagram for Wizt::VManagedObject:
Wizt::VManagedObjectBase MemCore::Intercube MemCore::MutableName MemCore::ReferenceBase< VManagedObjectBase > Wizt::VManagedDomainObject< VInputCreatorBase > Wizt::VManagedDomainObject< VNutrition > Wizt::VManagedDomainObject< VObject > Wizt::VManagedDomainObject< What > Wizt::VInputCreatorBase Wizt::VNutrition Wizt::VObject Wizt::VInputCreator< GLFontManager > Wizt::VInputCreator< MetaViewerInputType > Wizt::VInputCreator< VSocketAction > Wizt::VInputCreator< VThreadManager > Wizt::VCreatorBase Wizt::VInputCreator< InputType, VInputCreatorClass > Wizt::AnemoneNutrition FloatsToPoint2D Wizt::CatchStatus Wizt::Coral Wizt::HTTPServer Wizt::MetaViewer Wizt::MovieRecorder Wizt::RemoteVish Wizt::RenderAble Wizt::VChartSelector Wizt::VProxyObject Wizt::VScene Wizt::VStreamObject Wizt::Viewer

Classes

class  ModuleIterator
 Abstract iterator class. More...
 
struct  VRemoveItem
 Callback object when unloading a module. More...
 

Public Member Functions

virtual const type_info & getDomainType () const =0
 Get the domain group of this object.
 
string getLoadModule () const
 Get the name of the module that was active when loading/creating this object.
 
void insert (const string &s, int priority=DEFAULT_PRIORITY)
 Insert new objects into the object data base.
 
void remove ()
 Remove this object from the database.
 
void setPriority (int priority)
 Set the priority level in the database list.
 
 VManagedObject (const string &name, int priority=DEFAULT_PRIORITY)
 Constructor.
 
virtual ~VManagedObject ()
 Virtual destructor.
 
- Public Member Functions inherited from Wizt::VManagedObjectBase
 VManagedObjectBase ()
 Constructor.
 
 ~VManagedObjectBase ()
 Destructor.
 
- Public Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase >
auto getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain.
 
bool isIdentical (const WeakPtr< VManagedObjectBase, VManagedObjectBase > &PossibleSelf) const noexcept
 Check if this object is identical to the one used by the given pointer.
 
void mkAutoDestructive ()
 Marks this object as being automatically destructed, e.g.
 
refcount_t refcount () const noexcept
 The strong reference count.
 
 ReferenceBase (VManagedObjectBase *that) noexcept
 Constructor, initializes reference counter to zero.
 
const auto & self () const
 Return weak pointer to the object self.
 
refcount_t wrefcount () const noexcept
 The weak reference count.
 
- Public Member Functions inherited from MemCore::Intercube
void addInterface (const RefPtr< InterfaceBase > &I) const
 Add an interface class object.
 
template<class Data >
void addInterfaceData (const Data &D)
 Add data via an interface class object.
 
template<class Data , typename TypeSelector >
void addInterfaceData (const Data &D)
 Add data via an interface class object.
 
void clearInterfaces ()
 Remove all interfaces.
 
bool const_iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) const
 Constant iterator.
 
virtual RefPtr< InterfaceBasecreateInterface (const type_info &) const
 Virtual function which allows derived objects to create Interface objects on demand.
 
RefPtr< InterfaceBasefindInterface (const type_info &t) const
 Find a certain interface of specified type.
 
RefPtr< InterfaceBasegetInterface (const type_info &t)
 Retrieve an interface object from a certain type.
 
std::string getInterfaceNames (const char delim=';') const
 Debug function retrieving all interfaces as human-readable string.
 
template<class Data >
bool gotNewInterfaceData (const Data &D)
 Check whether data on the given interface have changed, and if so, set new data as interface.
 
template<class Data >
bool gotNewInterfaceData (mutex &M, const Data &D)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data , typename Selector >
bool gotNewInterfaceData (mutex &M, const Data &D)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data , typename Selector >
bool gotNewInterfaceData (mutex &M, const Data &D, const Selector &S)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data , typename Selector >
bool gotNewInterfaceData (mutex &M, const Data &D, const Selector *S)
 Check whether interface data have changed, if so, then set new interface data and return true.
 
template<class Data >
bool hasChangedInterfaceData (const Data &D) const
 Check whether interface data have changed.
 
template<class Data , typename Selector >
bool hasChangedInterfaceData (const Data &D) const
 Check whether interface data have changed.
 
template<class Data , typename Selector >
bool hasChangedInterfaceData (const Data &D, const Selector &) const
 Check whether interface data have changed.
 
template<class Data , typename Selector >
bool hasChangedInterfaceData (const Data &D, const Selector *) const
 Check whether interface data have changed.
 
bool hasInterface (const type_info &t) const
 Check if some Interface might exist.
 
 Intercube ()
 Constructor.
 
bool iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP)
 Modifyable iterator.
 
void printInterfaces () const
 Debug function that prints the names of all interfaces.
 
void registerInterface (const type_info &t)
 Register an interface type; when the interface is actually required, the virtual createInterface() function will be called.
 
template<class InterfaceType >
void removeInterface ()
 Remove an interface.
 
void removeInterfaceBase (const type_info &InterfaceBaseID)
 Remove an interface.
 
virtual ~Intercube ()
 Destructor.
 
- Public Member Functions inherited from MemCore::MutableName
void addNameChangeNotifier (const WeakPtr< Notifier > &)
 Add a new listener.
 
std::string BaseName (const char Separator) const
 return the name of this item cropped anything after the Separator
 
const std::string & getName () const
 The name of the object.
 
 MutableName (const std::string &theName)
 Construct from text.
 
const std::string & Name () const
 The name of the object.
 
void rename (const std::string &newName)
 rename, same as setName()
 
void setName (const std::string &newName)
 Set a new name.
 

Static Public Member Functions

static int count ()
 How many objects reside in the domain database at all?
 
static VManagedObjectPtr find (const type_info &, const std::string &s)
 Find a certain managed object by its name.
 
static bool InitDomain (const type_info &)
 An initialization function.
 
static int iterateModules (ModuleIterator &VIM)
 Iterate over all modules which have put objects into the object database so far.
 
static int size (const type_info &)
 How many objects reside in the domain database for a certain type?
 
static int traverse (const type_info &, VManagedObjectIterator &VIt, int p_start, int p_end)
 Iterate through a domain for certain levels.
 
static void UnloadVModule (const string &what, VRemoveItem &RI)
 Unload a certain module.
 
- Static Public Member Functions inherited from MemCore::MutableName
static std::string BaseName (const std::string &theName, const char Separator)
 return the name of this item cropped anything after the Separator
 

Static Public Attributes

static string CurrentLoadModule
 The name of the current shared library/DLL/plugin which provides the code of the currently loaded objects.
 

Additional Inherited Members

- Public Types inherited from MemCore::ReferenceBase< VManagedObjectBase >
using reference_domain_t = VManagedObjectBase
 The type of the base class.
 
using SelfPtr_t = WeakPtr< VManagedObjectBase, VManagedObjectBase >
 Type for a pointer to this object itself.
 
- Protected Member Functions inherited from MemCore::ReferenceBase< VManagedObjectBase >
virtual void extremeUnction ()
 A virtual function that will be called just before the object is destroyed.
 
ReferenceBaseoperator= (const ReferenceBase &R)
 Protected assignment operator (should not be called).
 
void suicide ()
 Delete this.
 
virtual ~ReferenceBase ()
 Virtual destructor.
 

Detailed Description

Common class for all objects that may be created through the database.

As a core property, each of them may contain various combinations of interfaces that determine the properties of the specific object instance.

Member Function Documentation

◆ insert()

void Wizt::VManagedObject::insert ( const string &  s,
int  priority = DEFAULT_PRIORITY 
)

Insert new objects into the object data base.

Note
The value of the global variable CurrentLoadModule is used to provide additional information about which module is responsible for the current object. In practice, only static objects in the respective module will be affected by this value through VLoadModule(). After loading the library has been finished, this CurrentLoadModule is set to empty, and this empty value is the one seen by dynamically created objects.

Note also that this due to the usage of this global variable the insertion routine is not threadsafe. However, this situation would only occur if two different shared libraries are loaded in different threads at the same time, which is not a good idea anyway.

References CurrentLoadModule, getDomainType(), and MemCore::MutableName::setName().

Referenced by Wizt::VManagedDomainObject< What >::VManagedDomainObject().

◆ remove()

void Wizt::VManagedObject::remove ( )

Remove this object from the database.

Note that the object is not deleted if strong reference points to it remain.

References MemCore::MutableName::Name(), and MemCore::ReferenceBase< VManagedObjectBase >::self().

Referenced by Wizt::VManagedDomainObject< What >::remove(), and Wizt::VManagedDomainObject< What >::remove().

◆ traverse()

int Wizt::VManagedObject::traverse ( const type_info &  t,
VManagedObjectIterator VIt,
int  p_start,
int  p_end 
)
static

Member Data Documentation

◆ CurrentLoadModule

string Wizt::VManagedObject::CurrentLoadModule
static

The name of the current shared library/DLL/plugin which provides the code of the currently loaded objects.

Note that this is a global variable and thus not threadsafe.

Referenced by insert(), Wizt::VCreatorBase::VCreatorBase(), and Wizt::VCreatorBase::VCreatorBase().