You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.7 KiB
68 lines
1.7 KiB
14 years ago
|
// ---------------------------------------------------------------------------
|
||
|
// Name: actIParam.h
|
||
|
// Product: cv act library
|
||
|
// Purpose: Declares act::IParam interface.
|
||
|
//
|
||
|
// Copyright: (c) 2006 cv cryptovision GmbH
|
||
|
// all rights reserved.
|
||
|
// Licence: The conditions for the use of this software are regulated
|
||
|
// in the cv act library licence agreement.
|
||
|
//
|
||
|
// Autor: Markus Tesche (MTE)
|
||
|
// Date: 3/1/2006
|
||
|
// ---------------------------------------------------------------------------
|
||
|
|
||
|
#ifndef ACT_IParam_h
|
||
|
#define ACT_IParam_h
|
||
|
|
||
|
#include "actBasics.h"
|
||
|
|
||
|
namespace act
|
||
|
{
|
||
|
class Blob;
|
||
|
|
||
|
enum
|
||
|
{
|
||
|
PARAM_ANY = -3,
|
||
|
PARAM_UNKNOWN_SIZE = -2,
|
||
|
PARAM_INVALID_VALUE = -1,
|
||
|
PARAM_FALSE = 0,
|
||
|
PARAM_TRUE = 1
|
||
|
};
|
||
|
|
||
|
static inline int param_bool(bool value)
|
||
|
{
|
||
|
return value == true ? PARAM_TRUE : PARAM_FALSE;
|
||
|
}
|
||
|
|
||
|
//
|
||
|
// IParam
|
||
|
class IParam
|
||
|
{
|
||
|
public:
|
||
|
virtual ~IParam() { }
|
||
|
|
||
|
virtual void SetParam(paramid_t id, int value) = 0;
|
||
|
virtual void SetParam(paramid_t id, const char* value) = 0;
|
||
|
virtual void SetParam(paramid_t id, const Blob& value) = 0;
|
||
|
|
||
|
//
|
||
|
// Get value for id, otherwise PARAM_INVALID_VALUE.
|
||
|
// NOTE: May throws an act::Exception derived exception.
|
||
|
virtual int GetParam(paramid_t id) const = 0;
|
||
|
|
||
|
//
|
||
|
// Get value for id, returns size[PARAM_UNKNOWN_SIZE|0-n] or PARAM_INVALID_VALUE.
|
||
|
// NOTE: May throws an act::Exception derived exception.
|
||
|
virtual size_t GetParam(paramid_t id, const char** value) const = 0;
|
||
|
|
||
|
//
|
||
|
// Get value for id, returns size[PARAM_UNKNOWN_SIZE|0-n] or PARAM_INVALID_VALUE.
|
||
|
// NOTE: May throws an act::Exception derived exception.
|
||
|
virtual size_t GetParam(paramid_t id, Blob& value) const = 0;
|
||
|
};
|
||
|
|
||
|
} // namespace act
|
||
|
|
||
|
#endif // ACT_IParam_h
|