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

Public Member Functions

 ResourceBundleManager ()
 Constructor.
 
virtual ~ResourceBundleManager ()
 Destructor.
 
ResourceBundleItemget_item (const CoreString &key)
 
ResourceBundleItemadd_item (const CoreString &key, ResourceData *data=0)
 
void copy_resource_list (const CoreArray< ResourceBundleItem * > &source, CoreArray< ResourceBundleItem * > &dest)
 
void release_item (const CoreString &key)
 
size_t get_memory_size () const override
 Get the memory size (in bytes) allocated by this instance.
 
- Public Member Functions inherited from ResourceData
 ResourceData (const ResourceData &other)
 
ResourceImportDataget_import_data () const
 
void set_import_data (ResourceImportData *data)
 
virtual Core128BitHashKey get_hash_key () const
 Get the hash key of the resource.
 
virtual bool is_serializable () const
 Tell if the resource can be serialized or not.
 
virtual void * serialize (size_t &serial_size) const
 Serialize the resource data.
 
virtual bool deserialize (void *serial, const size_t &serial_size)
 Deserialize the resource data.
 
void advert_memory_changed () const
 Adverts that the memory usage of the resource has changed.
 
bool is_protected () const
 
- 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 void get_statistics (SysStatistic &stats)
 Update the lite manager related stats.
 

Static Protected Member Functions

static bool global_lock (ResourceBundleManager *resource_bundle_manager=nullptr)
 
static void global_unlock ()
 Unlock the global list of resource bundle managers.
 

Friends

class GeometryObjectBundle
 
class GeometryPropertyBundle
 

Additional Inherited Members

- 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 *)
 

Detailed Description

Class defining a light resource manager. Unlike the resource manager, there is no complex link operation, no events. It is primarily designed to store Geometric data for GeometryBundles.

Member Function Documentation

ResourceBundleItem * ResourceBundleManager::add_item ( const CoreString key,
ResourceData data = 0 
)

Add an item into the manager.

Parameters
hash_keyThe key of the item
dataThe resource to associate to the item
Returns
The pointer on the new item or the pointer on the item that has this key.
Note
If an item with the same key already exists, its number of reference is incremented.
void ResourceBundleManager::copy_resource_list ( const CoreArray< ResourceBundleItem * > &  source,
CoreArray< ResourceBundleItem * > &  dest 
)

Makes a copy of a resource list and keep counters up to date

Note
Function called from the copy_from function of the GeometryObjectBundle.
ResourceBundleItem * ResourceBundleManager::get_item ( const CoreString key)

Return the item linked to the specified key.

Parameters
keyThe key of the item
Returns
The pointer on the item or a null pointer if it has not been found.
Note
If the item exists, its number of reference is incremented.
bool ResourceBundleManager::global_lock ( ResourceBundleManager resource_bundle_manager = nullptr)
staticprotected

Lock the global list of resource bundle managers and check if the resource_bundle_manager is still in the global list (meaning it's alive and can be used until unlock is called)

void ResourceBundleManager::release_item ( const CoreString key)

Notify the manager that the current key is no longer needed. Data can be freed when the requester count for a a key hits zero.