Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
OfVars Class Reference
Inheritance diagram for OfVars:
EventObject CoreCustomData CoreBaseObject CoreBaseType

Public Types

enum  Type {
  TYPE_SYSTEM = 0,
  TYPE_BUILTIN,
  TYPE_CUSTOM,
  TYPE_APP_PREFS,
  TYPE_PROJECT_PREFS,
  TYPE_COUNT
}
 
- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 event callback signature for free functions / static methods.
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 event callback signature for methods.
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 

Public Member Functions

 OfVars (OfObjectFactory &m_factory)
 
const OfAttrget_event_variable () const
 
const Type & get_event_variable_type () const
 
OfAttradd (const Type &var_type, const CoreString &name, const OfAttr::Type &type, const OfAttr::Container &container=OfAttr::CONTAINER_SINGLE, const OfAttr::VisualHint &visual_hint=OfAttr::VISUAL_HINT_DEFAULT)
 
void remove (const CoreString &name)
 Removes variable.
 
void remove_all (const Type &type)
 Removes all variable of a specific type.
 
void remove_all ()
 Removes all variable of all types.
 
void notify_rename (const CoreString &old_name, const CoreString &new_name)
 Send EVT_ID_VARS_RENAME_VARIABLE with old & new names in a CorePair as event custom data.
 
void notify_range_change (const CoreString &name)
 Send EVT_ID_VARS_VARIABLE_RANGES_CHANGED.
 
OfAttrexists (const CoreString &name) const
 returns OfAttr* if variable exists, 0 otherwise
 
OfAttrget (const CoreString &name) const
 returns OfAttr* if variable exists, 0 otherwise
 
Type get_type (const CoreString &name) const
 Gets type of variable with given name.
 
const unsigned int & get_count () const
 
OfAttrHandle get_by_index (const Type &type, const unsigned int &index) const
 
const unsigned int & get_count (const Type &type) const
 
OfObjectget_app_prefs () const
 
OfObjectget_project_prefs () const
 
OfObjectget_custom_vars () const
 
OfObjectget_builtin_vars () const
 
virtual size_t get_memory_size () const override
 
void serialize (ParserGroup *group)
 Serialize OfVars. Only custom variables will be serialized.
 
void deserialize (const ParserGroup *group, bool replace_existing=true)
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject () override
 Destructor.
 
void connect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
bool disconnect_all (EventObject &sender)
 Disconnects from all objects sender was listening on.
 
void disconnect_all ()
 Disconnects from all objects we were listening on.
 
void remove_all_connection ()
 Disconnects object from other objects it is listening to, and also disconnects all objects listening to it.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
bool is_connected (EventObject &sender, const CoreString &event_id, void *data)
 
void set_mute (const bool &mute)
 Asks for object muting. This will increase or decrease the muting counter. Unmuting may not be immediat since it will happen only when counter reaches 0.
 
bool is_mute () const
 Returns if object is muted.
 
CoreArray< EventObject * > get_senders () const
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
void connect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- Public Member Functions inherited from CoreCustomData
 CoreCustomData (const CoreCustomData &src)
 
void add_custom_data (void *key, const bool &data)
 
void add_custom_data (void *key, const int &data)
 
void add_custom_data (void *key, const unsigned int &data)
 
void add_custom_data (void *key, const char *data)
 
void add_custom_data (void *key, const CoreString &data)
 
void add_custom_data (void *key, const double &data)
 
void add_custom_data (void *key, void *data)
 
void remove_custom_data (void *key)
 
void remove_all_custom_data ()
 
void set_custom_data (void *key, const bool &data)
 
void set_custom_data (void *key, const int &data)
 
void set_custom_data (void *key, const unsigned int &data)
 
void set_custom_data (void *key, const double &data)
 
void set_custom_data (void *key, const char *data)
 
void set_custom_data (void *key, const CoreString &data)
 
void set_custom_data (void *key, void *data)
 
void get_custom_data (void *key, bool &data) const
 
void get_custom_data (void *key, int &data) const
 
void get_custom_data (void *key, unsigned int &data) const
 
void get_custom_data (void *key, double &data) const
 
void get_custom_data (void *key, CoreString &data) const
 
void get_custom_data (void *key, void *&data) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
CoreString get_class_info_name () const
 
const unsigned long & get_class_info_id () const
 
virtual bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 

Static Public Member Functions

static const char * get_type_name (const Type &type)
 Returns the stringified name of the enum type.
 
static const CoreStringget_ui_type_name (const Type &type)
 Returns the stringified name of the enum type for UI use (stripped from the beginning TYPE_).
 
- Static Public Member Functions inherited from EventObject
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 
static void raise_event (EventObject &sender, const CoreString &event_id)
 Sends an event.
 
static void raise_event (EventObject &sender, const EventInfo &event_info)
 Sends an event.
 
static void connect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- Static Public Member Functions inherited from CoreCustomData
static void * get_custom_data_key (const CoreString &key)
 
- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 
- Static Public Member Functions inherited from CoreBaseType
static const CoreClassInfoclass_info ()
 Get the type descriptor of this instance.
 

Member Function Documentation

OfAttr * OfVars::add ( const Type &  var_type,
const CoreString name,
const OfAttr::Type type,
const OfAttr::Container container = OfAttr::CONTAINER_SINGLE,
const OfAttr::VisualHint visual_hint = OfAttr::VISUAL_HINT_DEFAULT 
)

Adds a new variable. If it already exists, it will just return it.

Parameters
var_typeThe category of the variable
namevariable name
typeOptional data type. OfAttr::TYPE_STRING by default.
containerOptional container. OfAttr::CONTAINER_SINGLE by default.
visual_hintOptional visual hint. OfAttr::VISUAL_HINT_DEFAULT by default.
Returns
The newly created variable or the existing one.
Note
Variables types have ranks. From lower to higher: TYPE_SYSTEM, TYPE_CUSTOM, TYPE_APP_PREFS, TYPE_PROJECT_PREFS, TYPE_BUILTIN. When adding an already defined variable for a higher rank than the one it is defined, the variable is moved from the lower to the higher rank.
void OfVars::deserialize ( const ParserGroup group,
bool  replace_existing = true 
)

Deserialize OfVars. All deserialized variables are custom ones.

See Also
serialize
OfAttr * OfVars::exists ( const CoreString name) const

returns OfAttr* if variable exists, 0 otherwise

Parameters
namevariable name to look for
OfAttr * OfVars::get ( const CoreString name) const

returns OfAttr* if variable exists, 0 otherwise

Parameters
namevariable name to look for
void OfVars::notify_range_change ( const CoreString name)

Send EVT_ID_VARS_VARIABLE_RANGES_CHANGED.

Note
Actual change is not done here.
void OfVars::notify_rename ( const CoreString old_name,
const CoreString new_name 
)

Send EVT_ID_VARS_RENAME_VARIABLE with old & new names in a CorePair as event custom data.

Note
Actual renaming of a variable implies to remove it and re-add it with the new name. It is not done here.
void OfVars::remove ( const CoreString name)

Removes variable.

Parameters
[in]nameof the variable to be removed. Always refers to a real variable and not a pending one.
void OfVars::remove_all ( const Type &  type)

Removes all variable of a specific type.

Parameters
[in]typevariable type for which all variables must be removed