The Vish Visualization Shell 0.3
Vish
Classes | Public Member Functions | Static Public Member Functions | List of all members
Wizt::VActionNotifier Class Reference

Notifier object for actions. More...

#include <ocean/plankton/VActionNotifier.hpp>

Inheritance diagram for Wizt::VActionNotifier:
MemCore::ReferenceBase< VActionNotifier > ConsoleProgress Wizt::RemoteVish::MyActionNotifier

Classes

struct  CreationSource
 An optional property of the VObjectCreation()'s CreationContext telling why the object was created, meaning: which slot requested the creation of this object. More...
 
struct  Progress
 Helper class for following the progress of some slow activity. More...
 
struct  WarnInfo
 

Public Member Functions

bool activate ()
 Activate the current notifier object to receive notification callbacks.
 
virtual bool attachPrefix (const RefPtr< VParameter > &ProvidedParam, const RefPtr< VSlot > &DestSlot)
 The attach() function is called whenever a parameter is attached to the slot of an object.
 
virtual void createVObject (const RefPtr< VObject > &vobj, const Intercube &CreationContext, const WeakPtr< VCreatorBase > &crec)
 Virtual action of a notifier object which is hereby informed about the new creation of an object.
 
virtual void deleteVObject (const string &name)
 Virtual action of a notifier object which is hereby informed about the deletion of an object.
 
virtual bool progress (progress_id_t Pid, const string &name, int CurrentValue, int MaxValue)
 Implement display of some progress.
 
virtual void status (const string &name)
 Implement displaying some status.
 
virtual void terminate (const string &reason)
 Implement some function that is to be called during termination.
 
 VActionNotifier ()
 Constructs a notify callback object.
 
 ~VActionNotifier ()
 Destructor.
 
- Public Member Functions inherited from MemCore::ReferenceBase< VActionNotifier >
auto getObjectCountID () const noexcept
 Get a unique ID for this object in the given domain.
 
bool isIdentical (const WeakPtr< VActionNotifier, VActionNotifier > &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 (VActionNotifier *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.
 

Static Public Member Functions

static bool AttachParameterPrefix (const RefPtr< VParameter > &ProvidedParam, const RefPtr< VSlot > &DestSlot)
 Announce the intended attachment the provided parameter to the given Slot.
 
static progress_id_t getNewProgressID ()
 Get new progress identifier.
 
static bool ProgressInfo (progress_id_t Pid, const string &name, int CurrentValue, int MaxValue)
 Display some progress.
 
static void StatusInfo (const string &name)
 Show some status.
 
static void Terminate (const string &reason={})
 Terminate the application, optionally with some reason.
 
static void VObjectCreation (const RefPtr< VObject > &vobj, const Intercube &CreationContext, const WeakPtr< VCreatorBase > &crec=NullPtr())
 When a new VObject is created, call all of the registered Notifier objects.
 
static void VObjectDeletion (const string &name)
 Global call to inform that an object has been deleted.
 
static void Warning (const string &name)
 Issue a warning.
 

Additional Inherited Members

- Public Types inherited from MemCore::ReferenceBase< VActionNotifier >
using reference_domain_t = VActionNotifier
 The type of the base class.
 
using SelfPtr_t = WeakPtr< VActionNotifier, VActionNotifier >
 Type for a pointer to this object itself.
 
- Protected Member Functions inherited from MemCore::ReferenceBase< VActionNotifier >
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

Notifier object for actions.

Certain actions in VISH may be recorded through instances of VActionNotifier's. Events in VISH are broadcasted to all such instances.


Class Documentation

◆ Wizt::VActionNotifier::WarnInfo

struct Wizt::VActionNotifier::WarnInfo

Constructor & Destructor Documentation

◆ VActionNotifier()

Wizt::VActionNotifier::VActionNotifier ( )

Constructs a notify callback object.

It will not receive notification callbacks until the activate() function is called.

Member Function Documentation

◆ activate()

bool Wizt::VActionNotifier::activate ( )

Activate the current notifier object to receive notification callbacks.

Note
This function must be called only after a strong reference pointer has been established to hold this object alive.
Returns
false, if there is no strong reference pointer.

References MemCore::ReferenceBase< VActionNotifier >::self(), and Wizt::VManagedObject::traverse().

◆ attachPrefix()

bool Wizt::VActionNotifier::attachPrefix ( const RefPtr< VParameter > &  ProvidedParam,
const RefPtr< VSlot > &  DestSlot 
)
virtual

The attach() function is called whenever a parameter is attached to the slot of an object.

It is called just before this attachment takes place.

Parameters
DestSlotThe slot within object VObjDst whose parameter will be modified.
ProvidedParamThe parameter that will replace the one in the slot

◆ createVObject()

void Wizt::VActionNotifier::createVObject ( const RefPtr< VObject > &  vobj,
const Intercube CreationContext,
const WeakPtr< VCreatorBase > &  crec 
)
virtual

Virtual action of a notifier object which is hereby informed about the new creation of an object.

Parameters
CreationContextSome context information specific to this creation. It may hold arbitrary Interfaces.
crecThe Creator object. It may be Null if the VObject was created by other means.

Reimplemented in ConsoleProgress, and Wizt::RemoteVish::MyActionNotifier.

◆ ProgressInfo()

bool Wizt::VActionNotifier::ProgressInfo ( progress_id_t  Pid,
const string &  name,
int  CurrentValue,
int  MaxValue 
)
static

Display some progress.

Parameters
PidA unique ID per progress.
nameSome informative text to be displayed with this progress.
CurrentValueCurrent value, if it's same as MaxValue then this progress is finished.
MaxValueMaximal value.

◆ VObjectCreation()

void Wizt::VActionNotifier::VObjectCreation ( const RefPtr< VObject > &  vobj,
const Intercube CreationContext,
const WeakPtr< VCreatorBase > &  crec = NullPtr() 
)
static

When a new VObject is created, call all of the registered Notifier objects.

Parameters
CreationContextSome context information specific to this creation.
crecThe Creator object. It may be Null if the VObject was created by other means.

Referenced by Wizt::VCreator< DerivedVObject, AcceptedTypes >::create().

◆ VObjectDeletion()

void Wizt::VActionNotifier::VObjectDeletion ( const string &  name)
static

Global call to inform that an object has been deleted.

This call is automatically issued by the VObject::remove() call.

Referenced by Wizt::VObject::remove(), and Wizt::VObject::remove().

◆ Warning()

void Wizt::VActionNotifier::Warning ( const string &  name)
static