19 #ifndef TORC_BITSTREAM_FRAME_HPP
20 #define TORC_BITSTREAM_FRAME_HPP
22 #include <boost/cstdint.hpp>
23 #include <boost/shared_ptr.hpp>
24 #include <boost/shared_array.hpp>
31 template <
typename WORD_TYPE>
class Frame {
53 if(inWords && inLength) {
56 for(
uint32_t i = 0; i < inLength; i++) *p++ = *inWords++;
82 if(
mWords == 0 || index < 0 || static_cast<uint32_t>(index) >=
mLength)
return 0;
88 if(index < 0 || static_cast<uint32_t>(index) >=
mLength)
return;
97 if(
mWords[index] != inWord) {
115 #endif // TORC_BITSTREAM_FRAME_HPP
boost::shared_ptr< SpartanFrame > SpartanFrameSharedPtr
Spartan frame type.
bool mIsUsed
Flag to indicate whether the frame is in use.
bool isUsed(void) const
Returns a non-const raw word pointer.
WORD_TYPE * mWords
Array of frame words.
void setUsed(bool inIsUsed=true)
Marks the frame used or unused, and if unused automatically marks it clean.
word_t operator[](int index)
Returns the specified frame word, or 0 if out of bounds.
const word_t * getWords(void) const
Returns a const raw word pointer.
Frame< uint32_t > VirtexFrame
Virtex frame type.
void setDirty(bool inIsDirty=true)
Marks the frame dirty or clean, and if dirty automatically marks it used.
uint32_t mLength
Frame length in words.
Frame< uint16_t > Spartan6Frame
Spartan6 frame type.
boost::shared_ptr< Spartan6Frame > Spartan6FrameSharedPtr
Spartan6 frame type.
void setWord(int index, word_t inWord)
Sets the value of the specified frame word.
uint32_t getLength(void) const
Returns the length of the frame in words.
boost::shared_ptr< VirtexFrame > VirtexFrameSharedPtr
Virtex frame type.
bool mIsDirty
Flag to indicate whether the frame has been modified.
bool isDirty(void) const
Returns true if the frame has been modified, or false otherwise.
Frame(uint32_t inLength, word_t *inWords=0)
Basic constructor.
boost::uint32_t uint32_t
Imported type name.
WORD_TYPE word_t
Frame word type.
Frame< uint32_t > SpartanFrame
Spartan frame type.