Clarisse 4.0 SP9 SDK  4.0.0.0.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
OfContextEngine Class Reference
Inheritance diagram for OfContextEngine:
CoreBaseObject CoreBaseType OfOverridesContextEngine OfProjectContextEngine OfUnknownContextEngine OfFileReferenceContextEngine

Classes

struct  Descriptor
 
struct  ObjectSerial
 
struct  ParseSerialData
 

Public Types

typedef OfContextEngine *(* CreateEngineCallback )(OfContext &)
 
typedef ParseSerialData *(* ParseSerialCallback )(CoreVector< ParserEntry * > &, const CoreBasicArray< ParserEntry * > &)
 
typedef const Descriptor &(* GetDescriptorCallback )()
 

Public Member Functions

virtual void set_content_dirty (const bool &dirty_sub_contexts=false)
 
bool is_unknown_engine () const
 
bool is_project_engine () const
 
bool is_override_engine () const
 
bool is_file_reference_engine () const
 
const OfContextget_context () const
 
OfContextget_context ()
 
virtual const GuiIconget_icon () const
 
virtual ParserGroupget_settings () const
 
virtual void init (ParserGroup *settings=0)
 
OfAttradd_attribute (const OfItem::AttrCreationParams &params)
 
OfAttradd_attribute (const CoreString &name, const OfAttr::Type &type, const OfAttr::Container &container=OfAttr::CONTAINER_SINGLE, const OfAttr::VisualHint &visual_hint=OfAttr::VISUAL_HINT_DEFAULT, const CoreString &group_name="general")
 
void remove_all_attributes ()
 
void remove_attribute (const CoreString &name)
 
void remove_attribute (OfAttr &attr)
 
OfAttradd_custom_attribute (const OfItem::AttrCreationParams &params)
 
OfAttradd_custom_attribute (const CoreString &name, const OfAttr::Type &type, const OfAttr::Container &container=OfAttr::CONTAINER_SINGLE, const OfAttr::VisualHint &visual_hint=OfAttr::VISUAL_HINT_DEFAULT, const CoreString &group_name="general")
 
void remove_all_custom_attributes ()
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
virtual size_t get_memory_size () 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 const Descriptorget_descriptor ()
 
static void set_icon (const CoreClassInfo &engine_class_info, const GuiIcon *icon)
 
static void set_icon (const CoreString &engine_serial_name, const GuiIcon *icon)
 
- 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 ()
 

Protected Types

enum  Result {
  RESULT_DESERIALIZE_NONE,
  RESULT_DESERIALIZE_SOME,
  RESULT_DESERIALIZE_ALL
}
 
enum  DeserializingState {
  NOT_DESERIALIZING = 0,
  DESERIALIZING_OBJECT = 1<<0,
  DESERIALIZING_ATTR = 1<<1,
  NEXT_DESERIALIZING_VALUE = 1<<2
}
 
enum  PrivateFlags {
  NO_FLAGS = 0,
  FLAG_POPULATING_OPTIONS = 1,
  FLAG_RECREATING_ENGINE = 1<<1,
  NEXT_PRIVATE_FLAG = 1<<2
}
 

Protected Member Functions

 OfContextEngine (OfContext &ctx)
 
virtual bool populate_settings (ParserGroup &group, OfContext *context) const
 
void register_component_implementation ()
 
void _populate_options ()
 
virtual void populate_options ()
 
OfAttradd_option_attribute (const OfItem::AttrCreationParams &params)
 
OfAttradd_option_attribute (const CoreString &name, const OfAttr::Type &type, const OfAttr::Container &container=OfAttr::CONTAINER_SINGLE, const OfAttr::VisualHint &visual_hint=OfAttr::VISUAL_HINT_DEFAULT, const CoreString &group_name="general")
 
void remove_all_option_attributes ()
 
void _on_options_changed (OfObject &options)
 
virtual void on_options_changed (OfObject &options)
 
virtual void on_context_event (const CoreString &event)
 
virtual int on_item_event (const EventObject::EventInfo &event, OfItem *item)
 
bool is_serializing () const
 
bool is_deserializing () const
 
void add_state_deserializing (const int state)
 
void remove_state_deserializing (const int state)
 
bool is_state_deserializing (const int state) const
 
void add_private_flag (const int flag)
 
void remove_private_flag (const int flag)
 
bool is_private_flag (const int flag) const
 
virtual ParserEntryserialize (ParserEntry *entry, const OfSerialOptions &options, AppProgressBar *progress_bar) const
 
virtual ParserEntryserialize_export (ParserEntry *entry, const OfSerialOptions &options, AppProgressBar *progress_bar) const
 
virtual Result deserialize_objects (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
virtual void deserialize_attrs (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
virtual Result do_deserialize_objects (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
virtual void do_deserialize_attrs (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar)
 

Static Protected Member Functions

static OfContextEnginecreate_engine (OfContext &ctx)
 
static ParseSerialDataparse_serial (CoreVector< ParserEntry * > &sub_ctx_entries, const CoreBasicArray< ParserEntry * > &serial_entries)
 
static void prepare_serial_data (ParseSerialData &serial_data, CoreVector< ParserEntry * > &sub_ctx_entries, const CoreBasicArray< ParserEntry * > &serial_entries)
 
static Result deserialize_data_objects (ParseSerialData &serial_data, OfContextEngine &target_context, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
static void deserialize_data_attrs (ParseSerialData &serial_data, OfContextEngine &target_context, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
static void deserialize_data_options (ParseSerialData &serial_data, OfContextEngine &target_context, const OfSerialOptions &options)
 
static ParserEntryserialize_options (const OfContext &context, const OfSerialOptions &serial_options)
 
static void deserialize_options (OfContext &context, const ParserEntry *serial, const OfSerialOptions &serial_options)
 

Protected Attributes

OfContextm_ctx
 
char m_flag_deserializing
 
unsigned int m_private_flags
 
CoreVector< OfAttr * > m_option_attrs
 
CoreVector< OfAttr * > m_custom_attrs
 
bool m_is_serializing
 

Friends

class OfContext
 
class OfOverrides
 
class OfFileReferenceContextEngine
 

Class Documentation

struct OfContextEngine::Descriptor
Class Members
const CoreClassInfo * class_info
CreateEngineCallback create_engine
const GuiIcon * icon
ParseSerialCallback parse_serial
CoreString serial_name
struct OfContextEngine::ObjectSerial
Class Members
CoreString copy_from
const ParserEntry * entry
CoreString fullname
CoreString name
OfObject * object
bool override
ObjectSerial * parent
CoreString source

Member Function Documentation

OfAttr * OfContextEngine::add_attribute ( const OfItem::AttrCreationParams params)

Add an attribute. If an attribute with the given name already exists, returns that one instead. If called during populate_options, the attribute will be an option attribute, otherwise it will be created as a custom attribute.

Parameters
paramsAttribute creation parameters.
Returns
The created or existing attribute on success, nullptr on failure.
OfAttr * OfContextEngine::add_attribute ( const CoreString name,
const OfAttr::Type type,
const OfAttr::Container container = OfAttr::CONTAINER_SINGLE,
const OfAttr::VisualHint visual_hint = OfAttr::VISUAL_HINT_DEFAULT,
const CoreString group_name = "general" 
)

Add an attribute. If an attribute with the given name already exists, returns that one instead. If called during populate_options, the attribute will be an option attribute, otherwise it will be created as a custom attribute.

Parameters
nameAttribute name.
typeAttribute type.
containerAttribute container type.
visual_hintAttribute visual hint.
group_nameAttribute group name.
Returns
The created or existing attribute on success, nullptr on failure.
OfAttr * OfContextEngine::add_custom_attribute ( const OfItem::AttrCreationParams params)

Add a custom attribute. If an attribute with the given name already exists, returns that one instead.

Parameters
paramsAttribute creation parameters.
Returns
The created or existing attribute on success, nullptr on failure.
OfAttr * OfContextEngine::add_custom_attribute ( const CoreString name,
const OfAttr::Type type,
const OfAttr::Container container = OfAttr::CONTAINER_SINGLE,
const OfAttr::VisualHint visual_hint = OfAttr::VISUAL_HINT_DEFAULT,
const CoreString group_name = "general" 
)

Add a custom attribute. If an attribute with the given name already exists, returns that one instead.

Parameters
nameAttribute name.
typeAttribute type.
containerAttribute container type.
visual_hintAttribute visual hint.
group_nameAttribute group name.
Returns
The created or existing attribute on success, nullptr on failure.
OfAttr * OfContextEngine::add_option_attribute ( const OfItem::AttrCreationParams params)
protected

Add an option attribute. If an attribute with the given name already exists, returns that one instead.

Parameters
paramsAttribute creation parameters.
Returns
The created or existing attribute on success, nullptr on failure.
OfAttr * OfContextEngine::add_option_attribute ( const CoreString name,
const OfAttr::Type type,
const OfAttr::Container container = OfAttr::CONTAINER_SINGLE,
const OfAttr::VisualHint visual_hint = OfAttr::VISUAL_HINT_DEFAULT,
const CoreString group_name = "general" 
)
protected

Add an option attribute. If an attribute with the given name already exists, returns that one instead.

Parameters
nameAttribute name.
typeAttribute type.
containerAttribute container type.
visual_hintAttribute visual hint.
group_nameAttribute group name.
Returns
The created or existing attribute on success, nullptr on failure.
void OfContextEngine::remove_all_attributes ( )

Remove all option and custom attributes.

void OfContextEngine::remove_all_custom_attributes ( )

Remove all custom attributes. Option attributes are kept.

void OfContextEngine::remove_all_option_attributes ( )
protected

Remove all option attributes. Custom attributes are kept.

Warning
Use with care. Options should be removed only when the context mutates its engine, for example when localizing a reference context, which replaces the OfFileReferenceContextEngine by an OfProjectContextEngine.
void OfContextEngine::remove_attribute ( const CoreString name)

Remove the attribute specified by the name.

Parameters
nameName of the attribute to remove.
void OfContextEngine::remove_attribute ( OfAttr attr)

Remove the specified attribute.

Parameters
attrAttribute to remove.