SHOGUN  6.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
List of all members | Public Member Functions
BaseAnyPolicy Class Referenceabstract

Detailed Description

An interface for a policy to store a value. Value can be any data like primitive data-types, shogun objects, etc. Policy defines how to handle this data. It works with a provided memory region and is able to set value, clear it and return the type-name as string.

Definition at line 77 of file any.h.

Inheritance diagram for BaseAnyPolicy:
[legend]

Public Member Functions

virtual void set (void **storage, const void *v) const =0
 
virtual void clear (void **storage) const =0
 
virtual std::string type () const =0
 
virtual bool matches (const std::type_info &ti) const =0
 
virtual bool equals (void **storage, void **other_storage) const =0
 
virtual std::string policy_name () const =0
 
virtual PolicyType policy_type () const =0
 

Member Function Documentation

virtual void clear ( void **  storage) const
pure virtual

Clears storage.

Parameters
storagepointer to a pointer to storage

Implemented in NonOwningAnyPolicy< T >, and PointerValueAnyPolicy< T >.

virtual bool equals ( void **  storage,
void **  other_storage 
) const
pure virtual

Compares two storages.

Parameters
storagepointer to a pointer to storage
other_storagepointer to a pointer to another storage
Returns
true if both storages have same value

Implemented in NonOwningAnyPolicy< T >, and PointerValueAnyPolicy< T >.

virtual bool matches ( const std::type_info &  ti) const
pure virtual

Compares type.

Parameters
titype information
Returns
true if type matches

Implemented in NonOwningAnyPolicy< T >, and PointerValueAnyPolicy< T >.

virtual std::string policy_name ( ) const
pure virtual

Returns the name of policy.

Returns
name of policy

Implemented in NonOwningAnyPolicy< T >, and PointerValueAnyPolicy< T >.

virtual PolicyType policy_type ( ) const
pure virtual

Returns the type of policy.

Returns
type of policy

Implemented in NonOwningAnyPolicy< T >, and PointerValueAnyPolicy< T >.

virtual void set ( void **  storage,
const void *  v 
) const
pure virtual

Puts provided value pointed by v (untyped to be generic) to storage.

Parameters
storagepointer to a pointer to storage
vpointer to value

Implemented in NonOwningAnyPolicy< T >, and PointerValueAnyPolicy< T >.

virtual std::string type ( ) const
pure virtual

Returns type-name as string.

Returns
name of type class

Implemented in NonOwningAnyPolicy< T >, and PointerValueAnyPolicy< T >.


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

SHOGUN Machine Learning Toolbox - Documentation