μHAL (v2.7.9)
Part of the IPbus software repository
Public Member Functions | Private Attributes | Friends | List of all members
uhal::ValWord< T > Class Template Reference

A class which wraps a single word of data and marks whether or not it is valid. More...

#include <uhal/ValMem.hpp>

Inheritance diagram for uhal::ValWord< T >:
[legend]
Collaboration diagram for uhal::ValWord< T >:
[legend]

Public Member Functions

 ValWord (const T &aValue, const uint32_t &aMask=defs::NOMASK)
 Constructor. More...
 
 ValWord (const ValWord< T > &aVal)
 Copy constructor. More...
 
 ValWord ()
 Default constructor. More...
 
bool valid ()
 Return whether the Validated memory is marked as valid. More...
 
void valid (bool aValid)
 Change the validatity state of the Validated memory. More...
 
ValWordoperator= (const T &aValue)
 Assignment operator - no check on whether the data has previously been marked as valid. More...
 
 operator T ()
 Return the value of the validated memory with check on validity. More...
 
value () const
 Return the value of the validated memory with check on validity. More...
 
void value (const T &aValue)
 If the memory has not previously been marked as valid, set the value. More...
 
const uint32_t & mask () const
 Return the mask used by this validated memory. More...
 
void mask (const uint32_t &aMask)
 Set the mask used by this validated memory. More...
 

Private Attributes

boost::shared_ptr< _ValWord_< T > > mMembers
 A shared pointer to a ValWord struct, so that every copy of this ValWord points to the same underlying memory. More...
 

Friends

class ClientInterface
 Make ClientInterface a friend so that it can access the members to get the info associated with the raw data space. More...
 
class ValHeader
 Make the ValHeader class a friend so we can downcast the members. More...
 

Detailed Description

template<typename T>
class uhal::ValWord< T >

A class which wraps a single word of data and marks whether or not it is valid.

Definition at line 73 of file ValMem.hpp.

Constructor & Destructor Documentation

◆ ValWord() [1/3]

template<typename T >
uhal::ValWord< T >::ValWord ( const T &  aValue,
const uint32_t &  aMask = defs::NOMASK 
)

Constructor.

Parameters
aValuea value to which the validated memory will be initialized
aMaska mask for modifying returned values

Definition at line 91 of file ValMem.cpp.

◆ ValWord() [2/3]

template<typename T >
uhal::ValWord< T >::ValWord ( const ValWord< T > &  aVal)

Copy constructor.

Parameters
aVala ValWord to copy

Definition at line 98 of file ValMem.cpp.

◆ ValWord() [3/3]

template<typename T >
uhal::ValWord< T >::ValWord

Default constructor.

Definition at line 105 of file ValMem.cpp.

Member Function Documentation

◆ mask() [1/2]

template<typename T >
const uint32_t & uhal::ValWord< T >::mask

Return the mask used by this validated memory.

Returns
the mask used by this validated memory

Definition at line 173 of file ValMem.cpp.

◆ mask() [2/2]

template<typename T >
void uhal::ValWord< T >::mask ( const uint32_t &  aMask)

Set the mask used by this validated memory.

Parameters
aMaskthe mask to be used by this validated memory

Definition at line 180 of file ValMem.cpp.

◆ operator T()

template<typename T >
uhal::ValWord< T >::operator T

Return the value of the validated memory with check on validity.

Returns
the value of the validated memory

Definition at line 134 of file ValMem.cpp.

◆ operator=()

template<typename T >
ValWord< T > & uhal::ValWord< T >::operator= ( const T &  aValue)

Assignment operator - no check on whether the data has previously been marked as valid.

Parameters
aValueChange the value stored in the Validated memory
Returns
aReference to this ValWord for chained expressions

Definition at line 126 of file ValMem.cpp.

References uhal::ValWord< T >::value().

◆ valid() [1/2]

template<typename T >
bool uhal::ValWord< T >::valid

Return whether the Validated memory is marked as valid.

Returns
whether the Validated memory is marked as valid

Definition at line 112 of file ValMem.cpp.

Referenced by uhal::tests::job_multiple(), and uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES().

◆ valid() [2/2]

template<typename T >
void uhal::ValWord< T >::valid ( bool  aValid)

Change the validatity state of the Validated memory.

Parameters
aValidthe new validity state of the Validated memory

Definition at line 119 of file ValMem.cpp.

◆ value() [1/2]

template<typename T >
T uhal::ValWord< T >::value

◆ value() [2/2]

template<typename T >
void uhal::ValWord< T >::value ( const T &  aValue)

If the memory has not previously been marked as valid, set the value.

Parameters
aValuethe value of the validated memory

Definition at line 157 of file ValMem.cpp.

References uhal::log().

Friends And Related Function Documentation

◆ ClientInterface

template<typename T >
friend class ClientInterface
friend

Make ClientInterface a friend so that it can access the members to get the info associated with the raw data space.

Definition at line 193 of file ValMem.hpp.

◆ ValHeader

template<typename T >
friend class ValHeader
friend

Make the ValHeader class a friend so we can downcast the members.

Definition at line 196 of file ValMem.hpp.

Member Data Documentation

◆ mMembers

template<typename T >
boost::shared_ptr< _ValWord_<T> > uhal::ValWord< T >::mMembers
private

A shared pointer to a ValWord struct, so that every copy of this ValWord points to the same underlying memory.

Definition at line 266 of file ValMem.hpp.

Referenced by uhal::ClientInterface::CreateValWord().


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