Common::GaOperationParametersPair< OTYPE, PTYPE > Class Template Reference

This template class is used for storing genetic operations and their parameters. This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class. More...

#include <D:/Temp/vs/gal/source/Operation.h>

List of all members.

Public Member Functions

 GaOperationParametersPair (OTYPE *operation, PTYPE &parameters)
 This constructor initializes operation's and parameters' pointers with user-defined values. Parameter's object is cloned and pointer to the new object is stored in the pair.
 GaOperationParametersPair ()
 This constructor initializes operation's and parameters' pointers with NULL values.
 ~GaOperationParametersPair ()
 Destructor frees memory allocated by parameters' object which was made by cloning parameters' object which user specified by calling SetParameters, SetOperation or when pair's object is constructed.
OTYPE &GACALL GetOperation () const
 This method is not thread-safe.
void GACALL SetOperation (OTYPE *operation, PTYPE &parameters)
 SetOperation method stores pointer to operation's object. It stores parameters stored by calling SetParameters method.
PTYPE &GACALL GetParameters () const
 This method is not thread-safe.
void GACALL SetParameters (PTYPE &parameters)
 SetParameters operation makes copy of (clones) user specified parameter's object and stores pointer to that object. If pointer to parameters/ object was defined prior the call, this method deletes object to which it was pointing.
bool GACALL HasOperation () const
 This method is not thread-safe.
bool GACALL HasParameters () const
 This method is not thread-safe.

Private Attributes

OTYPE * _operation
 Pointer to operation's object.
PTYPE * _parameters
 Pointer to parameters' object.


Detailed Description

template<typename OTYPE, typename PTYPE>
class Common::GaOperationParametersPair< OTYPE, PTYPE >

This template class is used for storing genetic operations and their parameters. This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class.

No public or private methods are thread-safe.

Parameters:
OTYPE Type of operation.
PTYPE Type of parameters.

Constructor & Destructor Documentation

template<typename OTYPE, typename PTYPE>
Common::GaOperationParametersPair< OTYPE, PTYPE >::GaOperationParametersPair ( OTYPE *  operation,
PTYPE &  parameters 
) [inline]

This constructor initializes operation's and parameters' pointers with user-defined values. Parameter's object is cloned and pointer to the new object is stored in the pair.

Parameters:
operation pointer to operation's object
parameters pointer to the object of operation's parameters

template<typename OTYPE, typename PTYPE>
Common::GaOperationParametersPair< OTYPE, PTYPE >::GaOperationParametersPair (  )  [inline]

This constructor initializes operation's and parameters' pointers with NULL values.

template<typename OTYPE, typename PTYPE>
Common::GaOperationParametersPair< OTYPE, PTYPE >::~GaOperationParametersPair (  )  [inline]

Destructor frees memory allocated by parameters' object which was made by cloning parameters' object which user specified by calling SetParameters, SetOperation or when pair's object is constructed.


Member Function Documentation

template<typename OTYPE, typename PTYPE>
OTYPE& GACALL Common::GaOperationParametersPair< OTYPE, PTYPE >::GetOperation (  )  const [inline]

This method is not thread-safe.

Returns:
Returns reference to operation's object.

template<typename OTYPE, typename PTYPE>
void GACALL Common::GaOperationParametersPair< OTYPE, PTYPE >::SetOperation ( OTYPE *  operation,
PTYPE &  parameters 
) [inline]

SetOperation method stores pointer to operation's object. It stores parameters stored by calling SetParameters method.

This method is not thread-safe.

Parameters:
operation pointer to operation's object which will be stored in the pair.
parameters reference to parameters' object who's copy will be stored in the pair.

template<typename OTYPE, typename PTYPE>
PTYPE& GACALL Common::GaOperationParametersPair< OTYPE, PTYPE >::GetParameters (  )  const [inline]

This method is not thread-safe.

Returns:
Returns reference to parameter's object.

template<typename OTYPE, typename PTYPE>
void GACALL Common::GaOperationParametersPair< OTYPE, PTYPE >::SetParameters ( PTYPE &  parameters  )  [inline]

SetParameters operation makes copy of (clones) user specified parameter's object and stores pointer to that object. If pointer to parameters/ object was defined prior the call, this method deletes object to which it was pointing.

This method is not thread-safe.

Parameters:
parameters reference to parameters' object who's copy will be stored in the pair.

template<typename OTYPE, typename PTYPE>
bool GACALL Common::GaOperationParametersPair< OTYPE, PTYPE >::HasOperation (  )  const [inline]

This method is not thread-safe.

Returns:
Returns true if pair contains pointer to an operation's object, otherwise it returns false.

template<typename OTYPE, typename PTYPE>
bool GACALL Common::GaOperationParametersPair< OTYPE, PTYPE >::HasParameters (  )  const [inline]

This method is not thread-safe.

Returns:
Returns true if pair contains pointer to an operation's object, otherwise it returns false.


Member Data Documentation

template<typename OTYPE, typename PTYPE>
OTYPE* Common::GaOperationParametersPair< OTYPE, PTYPE >::_operation [private]

Pointer to operation's object.

template<typename OTYPE, typename PTYPE>
PTYPE* Common::GaOperationParametersPair< OTYPE, PTYPE >::_parameters [private]

Pointer to parameters' object.


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

Genetic Algorithm Library
Coolsoft Software Development