Open CASCADE Technology  6.9.1
Public Member Functions | Static Public Member Functions
IFSelect_Act Class Reference

Act gives a simple way to define and add functions to be ran from a SessionPilot, as follows : More...

#include <IFSelect_Act.hxx>

Inheritance diagram for IFSelect_Act:
Inheritance graph
[legend]

Public Member Functions

 IFSelect_Act (const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func)
 Creates an Act with a name, help and a function mode (Add or AddSet) is given when recording. More...
 
IFSelect_ReturnStatus Do (const Standard_Integer number, const Handle< IFSelect_SessionPilot > &pilot)
 Execution of Command Line. remark that <number> is senseless because each Act brings one and only one function. More...
 
Standard_CString Help (const Standard_Integer number) const
 Short Help for commands : returns the help given to create. More...
 
- Public Member Functions inherited from IFSelect_Activator
void Add (const Standard_Integer number, const Standard_CString command) const
 Allows a self-definition by an Activator of the Commands it processes, call the class method Adding (mode 0) More...
 
void AddSet (const Standard_Integer number, const Standard_CString command) const
 Same as Add but specifies that this command is candidate for xset (creation of items, xset : named items; mode 1) More...
 
Standard_CString Group () const
 
Standard_CString File () const
 
void SetForGroup (const Standard_CString group, const Standard_CString file="")
 Group and SetGroup define a "Group of commands" which correspond to an Activator. Default is "XSTEP" Also a file may be attached. More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const Handle_Standard_Type & DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Member Functions

static void SetGroup (const Standard_CString group, const Standard_CString file="")
 Changes the default group name for the following Acts group empty means to come back to default from Activator Also a file name can be precised (to query by getsource) More...
 
static void AddFunc (const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func)
 Adds a function with its name and help : creates an Act then records it as normal function. More...
 
static void AddFSet (const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func)
 Adds a function with its name and help : creates an Act then records it as function for XSET (i.e. to create control item) More...
 
- Static Public Member Functions inherited from IFSelect_Activator
static void Adding (const Handle< IFSelect_Activator > &actor, const Standard_Integer number, const Standard_CString command, const Standard_Integer mode)
 Records, in a Dictionary available for all the Activators, the command title an Activator can process, attached with its number, proper for this Activator <mode> allows to distinguish various execution modes 0: default mode; 1 : for xset. More...
 
static void Remove (const Standard_CString command)
 Removes a Command, if it is recorded (else, does nothing) More...
 
static void SetAlias (const Standard_CString conf, const Standard_CString command, const Standard_CString aliasname)
 Records, for a configuration named <conf>, that the command <command> may be aliased by another command <alias> More...
 
static void SetCurrentAlias (const Standard_CString conf)
 Sets <conf> as current configuration for aliases. More...
 
static TCollection_AsciiString Alias (const Standard_CString command)
 Returns, in the current configuration, what alias has been recorded for <command> The returned string is empty if no alias is recorded. More...
 
static Standard_Boolean Select (const Standard_CString command, Standard_Integer &number, Handle< IFSelect_Activator > &actor)
 Selects, for a Command given by its title, an actor with its command number. Returns True if found, False else. More...
 
static Standard_Integer Mode (const Standard_CString command)
 Returns mode recorded for a command. -1 if not found. More...
 
static Handle< TColStd_HSequenceOfAsciiStringCommands (const Standard_Integer mode=-1, const Standard_CString command="")
 Returns, for a root of command title, the list of possible commands. <mode> : -1 (D) for all commands if <commands> is empty -1 + command : about a Group , >= 0 see Adding By default, it returns the whole list of known commands. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IFSelect_Activator
 IFSelect_Activator ()
 Sets the default values. More...
 

Detailed Description

Act gives a simple way to define and add functions to be ran from a SessionPilot, as follows :

Define a function as static IFSelect_RetStatus myfunc (const Standard_CString name, const Handle(IFSelect_SessionPilot)& pilot) { ... } When ran, it receives the exact name (string) of the called function, and the SessionPilot which brings other infos

Add it by IFSelect_Act::AddFunc (name,help,myfunc); for a normal function, or IFSelect_Act::AddFSet (name,help,myfunc); for a function which is intended to create a control item name and help are given as CString

Then, it is available for run

Constructor & Destructor Documentation

IFSelect_Act::IFSelect_Act ( const Standard_CString  name,
const Standard_CString  help,
const IFSelect_ActFunc  func 
)

Creates an Act with a name, help and a function mode (Add or AddSet) is given when recording.

Member Function Documentation

static void IFSelect_Act::AddFSet ( const Standard_CString  name,
const Standard_CString  help,
const IFSelect_ActFunc  func 
)
static

Adds a function with its name and help : creates an Act then records it as function for XSET (i.e. to create control item)

static void IFSelect_Act::AddFunc ( const Standard_CString  name,
const Standard_CString  help,
const IFSelect_ActFunc  func 
)
static

Adds a function with its name and help : creates an Act then records it as normal function.

IFSelect_ReturnStatus IFSelect_Act::Do ( const Standard_Integer  number,
const Handle< IFSelect_SessionPilot > &  pilot 
)
virtual

Execution of Command Line. remark that <number> is senseless because each Act brings one and only one function.

Implements IFSelect_Activator.

Standard_CString IFSelect_Act::Help ( const Standard_Integer  number) const
virtual

Short Help for commands : returns the help given to create.

Implements IFSelect_Activator.

static void IFSelect_Act::SetGroup ( const Standard_CString  group,
const Standard_CString  file = "" 
)
static

Changes the default group name for the following Acts group empty means to come back to default from Activator Also a file name can be precised (to query by getsource)


The documentation for this class was generated from the following file: