Crypto++  5.6.3
Free C++ class library of cryptographic schemes
Public Member Functions | Static Public Member Functions | List of all members
NullNameValuePairs Class Reference
+ Inheritance diagram for NullNameValuePairs:

Public Member Functions

bool GetVoidValue (const char *name, const std::type_info &valueType, void *pValue) const
 Get a named value. More...
 
template<class T >
bool GetThisObject (T &object) const
 Get a copy of this object or subobject. More...
 
template<class T >
bool GetThisPointer (T *&ptr) const
 Get a pointer to this object. More...
 
template<class T >
bool GetValue (const char *name, T &value) const
 Get a named value. More...
 
template<class T >
GetValueWithDefault (const char *name, T defaultValue) const
 Get a named value. More...
 
std::string GetValueNames () const
 Get a list of value names that can be retrieved. More...
 
bool GetIntValue (const char *name, int &value) const
 Get a named value with type int. More...
 
int GetIntValueWithDefault (const char *name, int defaultValue) const
 Get a named value with type int, with default. More...
 
template<class T >
void GetRequiredParameter (const char *className, const char *name, T &value) const
 Retrieves a required name/value pair. More...
 
void GetRequiredIntParameter (const char *className, const char *name, int &value) const
 Retrieves a required name/value pair. More...
 

Static Public Member Functions

static void ThrowIfTypeMismatch (const char *name, const std::type_info &stored, const std::type_info &retrieving)
 Ensures an expected name and type is present. More...
 

Detailed Description

Definition at line 67 of file cryptlib.cpp.

Member Function Documentation

bool NullNameValuePairs::GetVoidValue ( const char *  name,
const std::type_info &  valueType,
void *  pValue 
) const
inlinevirtual

Get a named value.

Parameters
namethe name of the object or value to retrieve
valueTypereference to a variable that receives the value
pValuevoid pointer to a variable that receives the value
Returns
true if the value was retrieved, false otherwise

GetVoidValue() retrives the value of name if it exists.

Note
GetVoidValue() is an internal function and should be implemented by derived classes. Users should use one of the other functions instead.
See also
GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), GetRequiredParameter() and GetRequiredIntParameter()

Implements NameValuePairs.

Definition at line 70 of file cryptlib.cpp.

References g_nullNameValuePairs.

template<class T >
bool NameValuePairs::GetThisObject ( T &  object) const
inlineinherited

Get a copy of this object or subobject.

Template Parameters
Tclass or type
Parameters
objectreference to a variable that receives the value

Definition at line 297 of file cryptlib.h.

Referenced by DL_PrivateKeyImpl< DL_GroupParameters_EC< EC > >::GenerateRandom().

template<class T >
bool NameValuePairs::GetThisPointer ( T *&  ptr) const
inlineinherited

Get a pointer to this object.

Template Parameters
Tclass or type
Parameters
ptrreference to a pointer to a variable that receives the value

Definition at line 306 of file cryptlib.h.

template<class T >
bool NameValuePairs::GetValue ( const char *  name,
T &  value 
) const
inlineinherited
template<class T >
T NameValuePairs::GetValueWithDefault ( const char *  name,
defaultValue 
) const
inlineinherited
std::string NameValuePairs::GetValueNames ( ) const
inlineinherited

Get a list of value names that can be retrieved.

Returns
a list of names available to retrieve

the items in the list are delimited with a colon.

Definition at line 344 of file cryptlib.h.

Referenced by TestDataNameValuePairs::GetVoidValue().

bool NameValuePairs::GetIntValue ( const char *  name,
int &  value 
) const
inlineinherited

Get a named value with type int.

Parameters
namethe name of the value to retrieve
valuethe value retrieved upon success
Returns
true if an int value was retrieved, false otherwise

GetIntValue() is used to ensure we don't accidentally try to get an unsigned int or some other type when we mean int (which is the most common case)

See also
GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), GetRequiredParameter() and GetRequiredIntParameter()

Definition at line 355 of file cryptlib.h.

Referenced by KDF2_RNG::GenerateBlock(), DL_GroupParameters_IntegerBased::GenerateRandom(), InvertibleRabinFunction::GenerateRandom(), InvertibleRWFunction::GenerateRandom(), InvertibleESIGNFunction::GenerateRandom(), InvertibleLUCFunction::GenerateRandom(), InvertibleRSAFunction::GenerateRandom(), and DL_GroupParameters_DSA::GenerateRandom().

int NameValuePairs::GetIntValueWithDefault ( const char *  name,
int  defaultValue 
) const
inlineinherited
static void NameValuePairs::ThrowIfTypeMismatch ( const char *  name,
const std::type_info &  stored,
const std::type_info &  retrieving 
)
inlinestaticinherited

Ensures an expected name and type is present.

Parameters
namethe name of the value
storedthe type that was stored for the name
retrievingthe type that is being retrieved for the name
Exceptions
ValueTypeMismatch

ThrowIfTypeMismatch() effectively performs a type safety check. stored and retrieving are C++ mangled names for the type.

See also
GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), GetRequiredParameter() and GetRequiredIntParameter()

Definition at line 376 of file cryptlib.h.

Referenced by CombinedNameValuePairs::GetVoidValue().

template<class T >
void NameValuePairs::GetRequiredParameter ( const char *  className,
const char *  name,
T &  value 
) const
inlineinherited

Retrieves a required name/value pair.

Template Parameters
Tclass or type
Parameters
classNamethe name of the class
namethe name of the value
valuereference to a variable to receive the value
Exceptions
InvalidArgument

GetRequiredParameter() throws InvalidArgument if the name is not present or not of the expected type T.

See also
GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), GetRequiredParameter() and GetRequiredIntParameter()

Definition at line 390 of file cryptlib.h.

Referenced by DL_GroupParameters_EC< EC >::AssignFrom(), StringStore::CopyRangeTo2(), BaseN_Decoder::IsolatedInitialize(), Grouper::IsolatedInitialize(), and RandomNumberSink::IsolatedInitialize().

void NameValuePairs::GetRequiredIntParameter ( const char *  className,
const char *  name,
int &  value 
) const
inlineinherited

Retrieves a required name/value pair.

Parameters
classNamethe name of the class
namethe name of the value
valuereference to a variable to receive the value
Exceptions
InvalidArgument

GetRequiredParameter() throws InvalidArgument if the name is not present or not of the expected type T.

See also
GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(), GetRequiredParameter() and GetRequiredIntParameter()

Definition at line 405 of file cryptlib.h.

References g_nullNameValuePairs.

Referenced by StringStore::CopyRangeTo2(), and BaseN_Decoder::IsolatedInitialize().


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