NCBI C++ ToolKit
|
Search Toolkit Book for CPluginCommand
#include <gui/objects/PluginCommand.hpp>
Public Member Functions | |
CPluginCommand (void) | |
constructor More... | |
~CPluginCommand (void) | |
destructor More... | |
const CPluginArg & | operator[] (const string &name) const |
operator[] for indexing based on named argument this will throw if the named argument isn't found More... | |
CPluginArg & | operator[] (const string &name) |
void | ClearObjects () |
Clear all objects from object-based arguments. More... | |
bool | HasArgument (const string &name) const |
HasArgument() can be used to verify whether a named argument exists. More... | |
CPluginArg & | AddArgument (const string &name, const string &desc, CPluginArg::EType type, CPluginArg::TData::E_Choice single_or_array=CPluginArg::TData::e_Single) |
add a named argument. More... | |
CPluginArg & | AddArgument (const string &name, const string &desc, const CTypeInfo *info, CPluginArg::TData::E_Choice single_or_array=CPluginArg::TData::e_Single) |
add a named argument. More... | |
CPluginArg & | AddFlag (const string &name, const string &desc) |
Add a flag value. This is a helper API. More... | |
CPluginArg & | AddDefaultArgument (const string &name, const string &desc, CPluginArg::EType type, const string &val) |
Add a default argument to the set of arguments. More... | |
CPluginArg & | AddDefaultFlag (const string &name, const string &desc, bool val) |
Add a flag argument with a default value. This is a helper API. More... | |
CPluginArg & | AddOptionalArgument (const string &name, const string &desc, CPluginArg::EType type, CPluginArg::TData::E_Choice single_or_array=CPluginArg::TData::e_Single) |
add an optional argument to the set of arguments. More... | |
CPluginArg & | AddOptionalArgument (const string &name, const string &desc, const CTypeInfo *info, CPluginArg::TData::E_Choice single_or_array=CPluginArg::TData::e_Single) |
void | SetConstraint (const string &name, CPluginValueConstraint &constraint) |
set the constraint for a named argument, removing all previous constraints More... | |
void | AddConstraint (const string &name, CPluginValueConstraint &constraint) |
add a constraint to a named argument. More... | |
void | RemoveArgument (const string &arg_name) |
Delete an existing argument. More... | |
Public Member Functions inherited from CPluginCommand_Base | |
CPluginCommand_Base (void) | |
virtual | ~CPluginCommand_Base (void) |
DECLARE_INTERNAL_TYPE_INFO () | |
bool | IsSetCommand (void) const |
Check if a value has been assigned to Command data member. More... | |
bool | CanGetCommand (void) const |
Check if it is safe to call GetCommand method. More... | |
void | ResetCommand (void) |
Reset Command data member. More... | |
TCommand | GetCommand (void) const |
Get the Command member data. More... | |
void | SetCommand (TCommand value) |
Assign a value to Command data member. More... | |
TCommand & | SetCommand (void) |
Assign a value to Command data member. More... | |
bool | IsSetContext (void) const |
optional named context Check if a value has been assigned to Context data member. More... | |
bool | CanGetContext (void) const |
Check if it is safe to call GetContext method. More... | |
void | ResetContext (void) |
Reset Context data member. More... | |
const TContext & | GetContext (void) const |
Get the Context member data. More... | |
void | SetContext (const TContext &value) |
Assign a value to Context data member. More... | |
void | SetContext (TContext &&value) |
TContext & | SetContext (void) |
Assign a value to Context data member. More... | |
bool | IsSetArgs (void) const |
input arguments Check if a value has been assigned to Args data member. More... | |
bool | CanGetArgs (void) const |
Check if it is safe to call GetArgs method. More... | |
void | ResetArgs (void) |
Reset Args data member. More... | |
const TArgs & | GetArgs (void) const |
Get the Args member data. More... | |
void | SetArgs (TArgs &value) |
Assign a value to Args data member. More... | |
TArgs & | SetArgs (void) |
Assign a value to Args data member. More... | |
virtual void | Reset (void) |
Reset the whole object. More... | |
Public Member Functions inherited from CSerialObject | |
CSerialObject (void) | |
virtual | ~CSerialObject (void) |
virtual const CTypeInfo * | GetThisTypeInfo (void) const =0 |
virtual void | Assign (const CSerialObject &source, ESerialRecursionMode how=eRecursive) |
Set object to copy of another one. More... | |
virtual bool | Equals (const CSerialObject &object, ESerialRecursionMode how=eRecursive) const |
Check if both objects contain the same values. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
void | ThrowUnassigned (TMemberIndex index) const |
void | ThrowUnassigned (TMemberIndex index, const char *file_name, int file_line) const |
bool | HasNamespaceName (void) const |
Check if object data type has namespace name. More... | |
const string & | GetNamespaceName (void) const |
Get namespace name. More... | |
bool | HasNamespacePrefix (void) const |
Check if data type has namespace prefix. More... | |
const string & | GetNamespacePrefix (void) const |
Get namespace prefix. More... | |
Public Member Functions inherited from CObject | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
Public Member Functions inherited from CDebugDumpable | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Private Types | |
typedef CPluginCommand_Base | Tparent |
Private Member Functions | |
CPluginCommand (const CPluginCommand &value) | |
Prohibit copy constructor and assignment operator. More... | |
CPluginCommand & | operator= (const CPluginCommand &value) |
Additional Inherited Members | |
Public Types inherited from CPluginCommand_Base | |
enum | ECommand { eCommand_no_command = 0 , eCommand_init = 1 , eCommand_get_status = 2 , eCommand_finish = 3 , eCommand_abort = 4 , eCommand_create_interface = 5 , eCommand_load = 6 , eCommand_save = 7 , eCommand_import = 8 , eCommand_load_project = 9 , eCommand_save_project = 10 , eCommand_search = 11 , eCommand_manage = 12 , eCommand_run = 13 , eCommand_suspend = 14 , eCommand_resume = 15 , eCommand_new_view = 16 , eCommand_new_composite_view = 17 } |
enum class | E_memberIndex { e__allMandatory = 0 , e_command , e_context , e_args } |
typedef ECommand | TCommand |
typedef string | TContext |
typedef CPluginArgSet | TArgs |
typedef Tparent::CMemberIndex< E_memberIndex, 4 > | TmemberIndex |
Public Types inherited from CObject | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Static Public Member Functions inherited from CPluginCommand_Base | |
static const NCBI_NS_NCBI::CEnumeratedTypeValues *ENUM_METHOD_NAME() | ECommand (void) |
Access to ECommand's attributes (values, names) as defined in spec. More... | |
Static Public Member Functions inherited from CSerialObject | |
static void | SetVerifyDataThread (ESerialVerifyData verify) |
static void | SetVerifyDataGlobal (ESerialVerifyData verify) |
static string | UnassignedString (void) |
static CStringUTF8 | UnassignedStringUTF8 (void) |
static char | UnassignedByte (void) |
Static Public Member Functions inherited from CObject | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
Static Public Member Functions inherited from CDebugDumpable | |
static void | EnableDebugDump (bool on) |
Static Public Attributes inherited from CSerialObject | |
static const char * | ms_UnassignedStr = "<*unassigned*>" |
static const char | ms_UnassignedByte = char(0xcd) |
Static Public Attributes inherited from CObject | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Definition at line 55 of file PluginCommand.hpp.
|
private |
Definition at line 57 of file PluginCommand.hpp.
|
inline |
constructor
Definition at line 139 of file PluginCommand.hpp.
CPluginCommand::~CPluginCommand | ( | void | ) |
destructor
Definition at line 52 of file PluginCommand.cpp.
|
private |
Prohibit copy constructor and assignment operator.
CPluginArg & CPluginCommand::AddArgument | ( | const string & | name, |
const string & | desc, | ||
const CTypeInfo * | info, | ||
CPluginArg::TData::E_Choice | single_or_array = CPluginArg::TData::e_Single |
||
) |
add a named argument.
This argument is required, and has no default value. Attempts to access the value without setting the value will result in an exception being thrown.
Definition at line 105 of file PluginCommand.cpp.
References CPluginArgSet::AddArgument(), and CPluginCommand_Base::SetArgs().
CPluginArg & CPluginCommand::AddArgument | ( | const string & | name, |
const string & | desc, | ||
CPluginArg::EType | type, | ||
CPluginArg::TData::E_Choice | single_or_array = CPluginArg::TData::e_Single |
||
) |
add a named argument.
This argument is required, and has no default value. Attempts to access the value without setting the value will result in an exception being thrown.
Definition at line 93 of file PluginCommand.cpp.
References CPluginArgSet::AddArgument(), and CPluginCommand_Base::SetArgs().
void CPluginCommand::AddConstraint | ( | const string & | name, |
CPluginValueConstraint & | constraint | ||
) |
add a constraint to a named argument.
Definition at line 169 of file PluginCommand.cpp.
References CPluginArgSet::AddConstraint(), and CPluginCommand_Base::SetArgs().
CPluginArg & CPluginCommand::AddDefaultArgument | ( | const string & | name, |
const string & | desc, | ||
CPluginArg::EType | type, | ||
const string & | val | ||
) |
Add a default argument to the set of arguments.
This function creates a named argument with a default value of type string.
Definition at line 123 of file PluginCommand.cpp.
References CPluginArgSet::AddDefaultArgument(), CPluginCommand_Base::SetArgs(), and val.
Add a flag argument with a default value. This is a helper API.
Definition at line 132 of file PluginCommand.cpp.
References CPluginArgSet::AddDefaultFlag(), CPluginCommand_Base::SetArgs(), and val.
CPluginArg & CPluginCommand::AddFlag | ( | const string & | name, |
const string & | desc | ||
) |
Add a flag value. This is a helper API.
Definition at line 114 of file PluginCommand.cpp.
References CPluginArgSet::AddFlag(), and CPluginCommand_Base::SetArgs().
CPluginArg & CPluginCommand::AddOptionalArgument | ( | const string & | name, |
const string & | desc, | ||
const CTypeInfo * | info, | ||
CPluginArg::TData::E_Choice | single_or_array = CPluginArg::TData::e_Single |
||
) |
Definition at line 152 of file PluginCommand.cpp.
References CPluginArgSet::AddOptionalArgument(), and CPluginCommand_Base::SetArgs().
CPluginArg & CPluginCommand::AddOptionalArgument | ( | const string & | name, |
const string & | desc, | ||
CPluginArg::EType | type, | ||
CPluginArg::TData::E_Choice | single_or_array = CPluginArg::TData::e_Single |
||
) |
add an optional argument to the set of arguments.
This supports an optional default value argument. For non-built-in types, the default value is ignored.
Definition at line 143 of file PluginCommand.cpp.
References CPluginArgSet::AddOptionalArgument(), and CPluginCommand_Base::SetArgs().
void CPluginCommand::ClearObjects | ( | ) |
Clear all objects from object-based arguments.
Definition at line 57 of file PluginCommand.cpp.
References CPluginArgSet::ClearObjects(), and CPluginCommand_Base::SetArgs().
Referenced by CPluginMessage::ClearObjects().
HasArgument() can be used to verify whether a named argument exists.
Definition at line 77 of file PluginCommand.cpp.
References CPluginCommand_Base::GetArgs(), and CPluginArgSet::HasArgument().
|
private |
CPluginArg & CPluginCommand::operator[] | ( | const string & | name | ) |
Definition at line 70 of file PluginCommand.cpp.
References CPluginCommand_Base::SetArgs().
const CPluginArg & CPluginCommand::operator[] | ( | const string & | name | ) | const |
operator[] for indexing based on named argument this will throw if the named argument isn't found
Definition at line 65 of file PluginCommand.cpp.
References CPluginCommand_Base::GetArgs().
Delete an existing argument.
Definition at line 83 of file PluginCommand.cpp.
References CPluginArgSet::RemoveArgument(), and CPluginCommand_Base::SetArgs().
void CPluginCommand::SetConstraint | ( | const string & | name, |
CPluginValueConstraint & | constraint | ||
) |
set the constraint for a named argument, removing all previous constraints
Definition at line 162 of file PluginCommand.cpp.
References CPluginCommand_Base::SetArgs(), and CPluginArgSet::SetConstraint().