Clarisse 4.0 SP10 SDK  4.0.0.0.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
OfObjectFactory Class Reference
Inheritance diagram for OfObjectFactory:
EventObject CoreCustomData CoreBaseObject CoreBaseType

Classes

struct  Keyable
 

Public Member Functions

 OfObjectFactory (OfApp &application, const CoreVector< CoreString > &module_path)
 
void init_vars ()
 
void init_root_context ()
 
OfAppget_application () const
 
bool load_project (ParserFile &file, OfSerialOptions &options, unsigned int &loaded_object_count, unsigned int &loaded_context_count, AppProgressBar *progress_bar)
 
OfContextget_root ()
 
const OfContextget_root () const
 
OfContextget_default ()
 
const OfContextget_default () const
 
const OfContextget_external_root () const
 
OfContextget_external_root ()
 
OfContextget_context (const CoreString &full_name) const
 
OfContextcontext_exists (const CoreString &full_name) const
 
OfObjectadd_generic_object (const CoreString &object_name, const int &object_flags=OfObject::FLAG_NONE)
 
OfObjectadd_object (const CoreString &object_name, const CoreString &class_name, const int &flags=OfObject::FLAG_NONE)
 
OfObjectadd_instance (const OfObject &source, const CoreString &name="", const int &flags=OfObject::FLAG_NONE)
 
OfObjectget_object (const CoreString &object_name) const
 
OfObjectobject_exists (const CoreString &object_name) const
 
unsigned int get_object_count () const
 
void remove_object (const CoreString &object_name)
 
void remove_object (OfObject &object)
 
void remove_all_objects ()
 
OfEnumadd_enum (const CoreString &name, const unsigned int &invalid_value=0)
 
OfEnumget_enum (const CoreString &name) const
 
OfEnumenum_exists (const CoreString &name) const
 
const unsigned int & get_enum_count () const
 
OfEnumget_enum (const unsigned int &index) const
 
void remove_enum (const CoreString &name)
 
void remove_enum (const unsigned int &index)
 
void remove_all_enums ()
 
void reset ()
 reset the factory to its starting setup
 
void rename_object (OfObject &object, const CoreString &new_name)
 
void rename_object (const CoreString &object, const CoreString &new_name)
 
OfAttrfind_attribute (const CoreString &path) const
 find an attribute by specifying its path
 
OfAttrfind_attribute (const CoreString &path, unsigned int &value_index) const
 find an attribute by specifying its path
 
OfAttrfind_attribute (const CoreString &path, bool &index_specified, unsigned int &value_index) const
 find an attribute by specifying its path
 
OfAttrfind_attribute (const CoreString &path, unsigned int &value_index, bool &is_array) const
 find an attribute by specifying its path
 
OfOutputfind_output_plug (const CoreString &path, unsigned int &plug_index) const
 find an output plug by specifying its path
 
void find_attribute_by_rule (CoreVector< OfAttr * > &retrieved_attrs, const CoreString &matching_rule, const bool &consider_embedded) const
 find a vector of attribute by specifying rule applied on the root context
 
void find_attribute_by_rule (CoreVector< OfAttr * > &retrieved_attrs, const CoreString &matching_rule, const OfContext &base_context, const bool &consider_embedded) const
 find a vector of attribute by specifying rule
 
bool is_attribute_matching_rule (const CoreString &prefix, const OfAttr *attribute, const CoreString &matching_rule) const
 checks if specified attribute and its parent object matches specified rule or not
 
void get_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const int &mask, const bool &inclusive=false) const
 
void get_all_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const int &mask, const bool &inclusive=false) const
 
void get_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_but_private_flags_mask) const
 
void get_all_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_but_private_flags_mask) const
 
void get_objects (CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 
void get_all_objects (CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 
void get_items (const CoreBasicArray< CoreString > &items_names, CoreVector< OfItem * > &items)
 
void get_items (const CoreBasicArray< CoreString > &items_names, CoreArray< OfItem * > &items)
 
void get_all_objects (const CoreBasicArray< CoreString > &items_names, CoreSet< OfObject * > &objects) const
 
OfItemget_item (const CoreString &full_name) const
 get an item by specifying its full name
 
OfItemitem_exists (const CoreString &full_name) const
 get an item by specifying its full name
 
void remove_item (const CoreString &full_name)
 remove an item by specifying its full name
 
void remove_items (const CoreBasicArray< CoreString > &full_names, AppProgressBar *bar=0)
 
void remove_items (const CoreBasicArray< OfItem * > &items, AppProgressBar *bar=0)
 
OfContextget_common_context (const CoreVector< OfItem * > &items) const
 return the lowest common context shared by the given items
 
OfContextget_common_context (const CoreVector< OfContext * > &contexts) const
 return the lowest common context shared by the given contexts
 
OfContextget_common_context (const CoreVector< OfObject * > &objects) const
 return the lowest common context shared by the given objects
 
void filter_items (CoreVector< OfItem * > &items) const
 filter the items so that a context or an object inside a context will be filtered out
 
void filter_items (const CoreVector< OfItem * > &items, CoreVector< OfContext * > &contexts, CoreVector< OfObject * > &objects) const
 filter the items so that a context or an object inside a context will be filtered out
 
OfClassFactoryget_classes () const
 
OfVarsget_vars () const
 
OfContextget_last_event_context () const
 
OfObjectget_last_event_object () const
 
OfEnumget_last_event_enum () const
 
ResourceManager * get_resource_manager () const
 
void set_resource_manager (ResourceManager *manager)
 
OfTimeget_time () const
 
void on_application_evaluation_interrupted (OfApp &sender, const CoreString &event, void *data)
 
void flush ()
 
const CoreVector
< OfObjectFactory::Keyable > & 
get_keyables () const
 
void set_key_to_keyables ()
 
void accept_keyables (const bool &flag)
 
unsigned int get_command_count () const
 
void add_command (Command_callback callback, OfCommandData *data)
 
void begin_protection_change ()
 
void end_protection_change ()
 
bool is_object_protected (const OfObject &object) const
 
void protect_objects (const CoreSet< OfObject * > &objects, const bool &protection_flag) const
 
bool get_copy_buffer (CoreString &copy_buffer, const CoreBasicArray< CoreString > &items_names, OfSerialOptions *options=nullptr, bool attach_resources=true)
 
bool get_copy_buffer_with_external_dependencies (CoreString &copy_buffer, const CoreBasicArray< CoreString > &items_names, OfSerialOptions &options, bool export_mode=false)
 
bool paste_copy_buffer (const CoreString &copy_buffer, OfContext &target_context, CoreVector< OfItem * > &created_items)
 
void get_statistics (SysStatistic &stats) const
 
void register_protection_callback (OfEndProtectionCallback cbk, void *data=0)
 add a callback that gets called when object protection ended
 
void unregister_protection_callback (OfEndProtectionCallback cbk, void *data=0)
 remove a registered callback
 
bool is_visible_item (const OfObject &item) const
 
bool is_visible_item (const OfContext &item) const
 
void get_items_dependencies (const CoreBasicArray< OfItem * > &objects, CoreVector< OfItem * > &output_items, const bool &recursive=false) const
 
void get_items_inputs (const CoreBasicArray< OfItem * > &objects, CoreVector< OfItem * > &output_items, const bool &recursive=false) const
 
void get_items_outputs (const CoreBasicArray< OfItem * > &objects, CoreVector< OfItem * > &output_items, const bool &recursive=false) const
 
void get_items_instances (const CoreBasicArray< OfItem * > &items, CoreVector< OfItem * > &output_items, const bool &recursive=false) const
 
void get_items_sources (const CoreBasicArray< OfItem * > &items, CoreVector< OfItem * > &output_items, const bool &recursive=false) const
 
void begin_attr_change_batch ()
 
void end_attr_change_batch ()
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject ()
 Destructor.
 
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.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
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.
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
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.
 
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.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
virtual size_t get_memory_size () const
 
- 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
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) 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
 
bool operator== (const CoreBaseType &obj) const
 

Static Public Member Functions

static void get_items_names (const CoreBasicArray< OfItem * > &items, CoreVector< CoreString > &items_names)
 
static const double & get_version ()
 
static void register_directives (OfApp &app)
 
- Static Public Member Functions inherited from EventObject
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 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 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, 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, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 
- 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 ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
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 bool ___class_destructor__ (void *instance, const bool &is_array)
 
static const CoreClassInfoclass_info ()
 

Friends

class OfObject
 
class OfAttr
 
class OfClassFactory
 
class OfClass
 
class OfContext
 
class OfTime
 
class OfEnum
 
class CtxEval
 
class AppEvalManager
 

Additional Inherited Members

- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 

Member Function Documentation

void OfObjectFactory::filter_items ( CoreVector< OfItem * > &  items) const

filter the items so that a context or an object inside a context will be filtered out

Parameters
itemsthe items to filter
Note
this method is used to for delete_selection and copy
void OfObjectFactory::filter_items ( const CoreVector< OfItem * > &  items,
CoreVector< OfContext * > &  contexts,
CoreVector< OfObject * > &  objects 
) const

filter the items so that a context or an object inside a context will be filtered out

Parameters
itemsthe items to filter
Note
this method is used to for delete_selection and copy
OfAttr * OfObjectFactory::find_attribute ( const CoreString path) const

find an attribute by specifying its path

Parameters
paththe path to the attribute
Returns
0 if the attribute is not found
OfAttr * OfObjectFactory::find_attribute ( const CoreString path,
unsigned int &  value_index 
) const

find an attribute by specifying its path

Parameters
paththe path to the attribute
value_indexthe attribute value index extracted from the path
Returns
0 if the attribute is not found
OfAttr * OfObjectFactory::find_attribute ( const CoreString path,
bool &  index_specified,
unsigned int &  value_index 
) const

find an attribute by specifying its path

Parameters
paththe path to the attribute
value_indexthe attribute value index extracted from the path
index_specifiedis setted to true if the attribute value index can have been extracted from the path
Returns
0 if the attribute is not found
OfAttr * OfObjectFactory::find_attribute ( const CoreString path,
unsigned int &  value_index,
bool &  is_array 
) const

find an attribute by specifying its path

Parameters
paththe path to the attribute
value_indexthe attribute value index extracted from the path
is_arraytell whether the attribute is an array or not
Returns
0 if the attribute is not found
void OfObjectFactory::find_attribute_by_rule ( CoreVector< OfAttr * > &  retrieved_attrs,
const CoreString matching_rule,
const bool &  consider_embedded 
) const

find a vector of attribute by specifying rule applied on the root context

Parameters
theresult of the search as a vector of attribute
therule to filter objects and attribute
specifiesto consider or not embedded objects
void OfObjectFactory::find_attribute_by_rule ( CoreVector< OfAttr * > &  retrieved_attrs,
const CoreString matching_rule,
const OfContext base_context,
const bool &  consider_embedded 
) const

find a vector of attribute by specifying rule

Parameters
theresult of the search as a vector of attribute
therule to filter objects and attribute
thebase context where to start searching if rule is relative
specifiesto consider or not embedded objects
OfOutput * OfObjectFactory::find_output_plug ( const CoreString path,
unsigned int &  plug_index 
) const

find an output plug by specifying its path

Parameters
paththe path to the plug
plug_indexthe plug index if found
Returns
0 if the plug is not found
OfContext & OfObjectFactory::get_common_context ( const CoreVector< OfItem * > &  items) const

return the lowest common context shared by the given items

Returns
root context if no item is specified
OfContext & OfObjectFactory::get_common_context ( const CoreVector< OfContext * > &  contexts) const

return the lowest common context shared by the given contexts

Returns
root context if no context is specified
OfContext & OfObjectFactory::get_common_context ( const CoreVector< OfObject * > &  objects) const

return the lowest common context shared by the given objects

Returns
root context if no object is specified
OfItem * OfObjectFactory::get_item ( const CoreString full_name) const

get an item by specifying its full name

Returns
0 if the item is not found
bool OfObjectFactory::is_attribute_matching_rule ( const CoreString prefix,
const OfAttr attribute,
const CoreString matching_rule 
) const

checks if specified attribute and its parent object matches specified rule or not

Parameters
fora relative rule, need to provide the name prefix the rule is relative to
theattribute to check
therule to test the attribute with
Returns
returns true if the attribute matches specified rule, false otherwise
OfItem * OfObjectFactory::item_exists ( const CoreString full_name) const

get an item by specifying its full name

Returns
0 if the item is not found
void OfObjectFactory::register_protection_callback ( OfEndProtectionCallback  cbk,
void *  data = 0 
)

add a callback that gets called when object protection ended

Parameters
cbkfunction callback to be called
dataoptionnal data passed to the callback
Note
this method should be exclusively used by experienced users. This method isn't thread safe!
void OfObjectFactory::remove_item ( const CoreString full_name)

remove an item by specifying its full name

Note
does nothing if the item is not found
void OfObjectFactory::reset ( )

reset the factory to its starting setup

Note
this method is used by 'New Project'
void OfObjectFactory::unregister_protection_callback ( OfEndProtectionCallback  cbk,
void *  data = 0 
)

remove a registered callback

Parameters
cbkfunction callback that was registered
dataoptionnal data that was passed when the callback was registered
Note
this method should be exclusively used by experienced users. In the event there were multiple registrations of a same callback, only the first occurence is removed. This method isn't thread safe!