Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
ModuleProcess Class Reference
Inheritance diagram for ModuleProcess:
ModuleProjectItem ModuleObject OfModule ResourceUser EventObject CoreCustomData CoreBaseObject CoreBaseType ModuleProcessScript

Public Member Functions

 ModuleProcess (const bool &is_abortable=true)
 
virtual ~ModuleProcess ()
 
bool run (const CoreBasicArray< CoreString > &args=CoreBasicArray< CoreString >(0, 0), const bool &is_abortable=true)
 
bool run (const CoreBasicArray< CoreString > &args, AppProgressBar &progress)
 
virtual bool run (AppProgressBar &progress)
 
virtual bool begin_process (AppProgressBar &progress)
 
virtual bool end_process (AppProgressBar &progress)
 
virtual bool run_process (AppProgressBar &progress)
 
virtual bool has_begun () const
 
virtual bool on_attr_override (OfAttr &attr, const CoreString &val)
 

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 *)
 
- Static Public Member Functions inherited from ModuleObject
static ResourceID declare_resource (const char *tag)
 
static ResourceID declare_resource (const CoreString &tag)
 
static bool declare_resource (ResourceID id, const char *tag)
 
static bool declare_resource (ResourceID id, const CoreString &tag)
 
static ResourceID get_resource_id (const char *tag)
 
static ResourceID get_resource_id (const CoreString &tag)
 
static const char * get_resource_tag (ResourceID id)
 
static void clear_unused_resources (SysThreadManager &thread_manager, const CoreBasicArray< OfObject * > &objects)
 
- Static Public Attributes inherited from ModuleObject
static constexpr unsigned int null_variation = 0
 Key of the null resource variation.
 
- Protected Member Functions inherited from ModuleProjectItem
virtual void module_constructor (OfObject &object) override
 

Detailed Description

ModuleProcess is the base class for implementing custom processes.

Constructor & Destructor Documentation

ModuleProcess::ModuleProcess ( const bool &  is_abortable = true)
explicit

Constructor. Initializes all callbacks with default implementations.

Parameters
is_abortableDefines if the process can be aborted.
ModuleProcess::~ModuleProcess ( )
virtual

Destructor.

Member Function Documentation

bool ModuleProcess::begin_process ( AppProgressBar progress)
virtual

Calls BeginProcessCallback. Intended for calling from a batch process.

Warning
Must not be used alone and must be called before run_process and end_process.

Consecutive calls to this method will not call BeginProcessCallback. This allows to save a lot of time when the process is called multiple times from a batch process.

Returns
On the first call, returns true if BeginProcessCallback succeeded, false if it failed. On intermediary calls, and if begin_process succeeded, always returns true.
bool ModuleProcess::end_process ( AppProgressBar progress)
virtual

Calls EndProcessCallback. Intended for calling from a batch process.

Warning
Must not be used alone and must be called between begin_process and end_process.

Intermediary calls to this method will not call EndProcessCallback.

Returns
On intermediary calls, always returns false. On the last call, returns true if EndProcessCallback succeeded, false if it failed.
bool ModuleProcess::has_begun ( ) const
virtual

Returns true if the process has succeeded to begin. Intended for calling from a batch process.

The batch process should not call run_process if this method returns false.

Returns
Returns true if begin_process was called, regardless of begin_process result. Returns false if the process hasn't begun yet or has finished (i.e. last end_process was called).
bool ModuleProcess::on_attr_override ( OfAttr attr,
const CoreString val 
)
virtual

Calls ProcessAttrOverrideCallback.

Parameters
attrThe overridden attribute.
valThe override value.
Returns
Returns the value of ProcessAttrOverrideCallback.
bool ModuleProcess::run ( const CoreBasicArray< CoreString > &  args = CoreBasicArray<CoreString>(0, 0),
const bool &  is_abortable = true 
)

Runs the begin-run-end callback sequence, with a list of arguments to override the process attributes.

A progress bar is automatically created.

Parameters
argsOptional arguments that will override the process attributes.
is_abortableOptional flag to define if the process can be aborted.
Returns
Returns the return value of RunProcessCallback.
bool ModuleProcess::run ( const CoreBasicArray< CoreString > &  args,
AppProgressBar progress 
)

Runs the begin-run-end callback sequence, with a list of arguments to override the process attributes.

Parameters
argsArguments that will override the process attributes.
Returns
Returns the return value of RunProcessCallback.
bool ModuleProcess::run ( AppProgressBar progress)
virtual

Runs the begin-run-end callback sequence.

Parameters
progressProcess progress bar.
Returns
Returns true if all 3 callbacks succeeded. Otherwise returns false and stops after the callback that failed.

Reimplemented in ModuleProcessScript.

bool ModuleProcess::run_process ( AppProgressBar progress)
virtual

Calls RunProcessCallback only. Intended for calling from a batch process.

Warning
Must not be used alone and must be called after begin_process and run_process.
Returns
Returns the return value of RunProcessCallback.