μHAL (v2.6.5)
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 without checking 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
 Return a std::deque containing all the IPbus headers returned during the transaction. 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 74 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 119 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 127 of file ValMem.cpp.

◆ ValWord() [3/3]

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

Default constructor.

Definition at line 134 of file ValMem.cpp.

Member Function Documentation

◆ mask() [1/2]

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

Return the mask used by this validated memory.

Returns
the mask used by this validated memory

Definition at line 215 of file ValMem.cpp.

Referenced by uhal::ValWord< uint32_t >::mask().

◆ 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 221 of file ValMem.cpp.

◆ operator T()

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

Return the value of the validated memory without checking validity.

Returns
the value of the validated memory
Todo:
should there be a validity check here

Definition at line 179 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
Todo:
should there be a validity check here

Definition at line 152 of file ValMem.cpp.

◆ 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 140 of file ValMem.cpp.

Referenced by uhal::tests::job_multiple(), uhal::tests::UHAL_TESTS_DEFINE_CLIENT_TEST_CASES(), and uhal::ValWord< uint32_t >::valid().

◆ 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 146 of file ValMem.cpp.

◆ value() [1/2]

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

◆ 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 200 of file ValMem.cpp.

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 212 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 215 of file ValMem.hpp.

Member Data Documentation

◆ mMembers

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

Return a std::deque containing all the IPbus headers returned during the transaction.

Returns
a std::deque containing all the IPbus headers returned during the transaction
Note
This is a deque, since a block transaction may be chunked into many smaller block transactionsA shared pointer to a ValWord struct, so that every copy of this ValWord points to the same underlying memory

Definition at line 286 of file ValMem.hpp.

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


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