|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
49 template<
typename T >
60 template<
typename T >
90 template<
typename T >
92 mMembers ( new
_ValWord_<T> ( aValue , false , aMask ) )
97 template<
typename T >
99 mMembers ( aVal.mMembers )
104 template<
typename T >
106 mMembers ( new
_ValWord_<T> ( T() , false , 0xFFFFFFFF ) )
111 template<
typename T >
114 return mMembers->valid;
118 template<
typename T >
121 mMembers->valid = aValid;
125 template<
typename T >
128 mMembers->
value = aValue ;
133 template<
typename T >
140 template<
typename T >
143 if ( mMembers->valid )
149 exception::NonValidatedMemory lExc;
150 log ( lExc ,
"Access attempted on non-validated memory" );
156 template<
typename T >
159 if ( !mMembers->valid )
161 mMembers->value = aValue;
165 exception::ValMemImutabilityViolation lExc;
166 log ( lExc ,
"Attempted to modify validated memory" );
172 template<
typename T >
175 return mMembers->mask;
179 template<
typename T >
182 mMembers->mask = aMask ;
188 template<
typename T >
190 mMembers ( new
_ValVector_<T> ( aValues , false ) )
195 template<
typename T >
197 mMembers ( aValues.mMembers )
202 template<
typename T >
204 mMembers ( new
_ValVector_<T> ( std::vector<T> ( aSize , T() ) , false ) )
209 template<
typename T >
211 mMembers ( new
_ValVector_<T> ( std::vector<T>() , false ) )
216 template<
typename T >
223 template<
typename T >
226 mMembers->
valid = aValid;
231 template<
typename T >
234 if ( !mMembers->valid )
236 mMembers->
value.push_back ( aValue );
240 exception::ValMemImutabilityViolation lExc;
241 log ( lExc ,
"Attempted to modify validated memory" );
247 template<
typename T >
250 if ( mMembers->valid )
252 return ( mMembers->value ) [aIndex];
256 exception::NonValidatedMemory lExc;
257 log ( lExc ,
"Access attempted on non-validated memory" );
263 template<
typename T >
266 if ( mMembers->valid )
268 return mMembers->
value.at ( aIndex );
272 exception::NonValidatedMemory lExc;
273 log ( lExc ,
"Access attempted on non-validated memory" );
279 template<
typename T >
282 return mMembers->
value.size();
286 template<
typename T >
289 mMembers->
valid =
false;
290 mMembers->value.clear();
294 template<
typename T >
297 if ( mMembers->valid )
299 return mMembers->
value.begin();
303 exception::NonValidatedMemory lExc;
304 log ( lExc ,
"Access attempted on non-validated memory" );
310 template<
typename T >
313 if ( mMembers->valid )
315 return mMembers->
value.end();
319 exception::NonValidatedMemory lExc;
320 log ( lExc ,
"Access attempted on non-validated memory" );
326 template<
typename T >
329 if ( mMembers->valid )
331 return mMembers->
value.rbegin();
335 exception::NonValidatedMemory lExc;
336 log ( lExc ,
"Access attempted on non-validated memory" );
342 template<
typename T >
345 if ( mMembers->valid )
347 return mMembers->
value.rend();
351 exception::NonValidatedMemory lExc;
352 log ( lExc ,
"Access attempted on non-validated memory" );
358 template<
typename T >
361 if ( mMembers->valid )
363 return mMembers->
value;
367 exception::NonValidatedMemory lExc;
368 log ( lExc ,
"Access attempted on non-validated memory" );
373 template<
typename T >
376 if ( !mMembers->valid )
378 mMembers->
value = aValue;
382 exception::ValMemImutabilityViolation lExc;
383 log ( lExc ,
"Attempted to modify validated memory" );
A class which wraps a block of data and marks whether or not it is valid.
bool valid()
Return whether the Validated memory is marked as valid.
T value() const
Return the value of the validated memory with check on validity.
_ValVector_(const std::vector< T > &aValue, const bool &aValid)
Constructor Private, since this struct should only be used by the ValVector.
_ValWord_(const T &aValue, const bool &aValid, const uint32_t aMask)
Constructor Private, since this struct should only be used by the ValWord.
const uint32_t & mask() const
Return the mask used by this validated memory.
void log(FatalLevel &aFatal, const T0 &aArg0)
Function to add a log entry at Fatal level.
std::vector< T >::const_reverse_iterator const_reverse_iterator
typedef iterator to be that of the underlying storage type
std::vector< T >::const_iterator const_iterator
typedef iterator to be that of the underlying storage type
std::vector< T > value() const
Return the value of the validated memory with check on validity.
ValWord & operator=(const T &aValue)
Assignment operator - no check on whether the data has previously been marked as valid.
ValVector()
Default constructor.
A class which wraps a single word of data and marks whether or not it is valid.
bool valid()
Return whether the Validated memory is marked as valid.
unsigned int TrailingRightBits(uint32_t aValue)
Helper function to calculate the number of zero-bits at the righthand end of a 32-bit number.
A Template helper struct wrapping a block of IPbus header, a register for storing a block of data and...
A Template helper struct wrapping an IPbus header, a register for storing a single word of data,...
ValWord()
Default constructor.