HOG2
FourBitArray.h
Go to the documentation of this file.
1 //
2 // FourBitArray.h
3 // hog2 glut
4 //
5 // Created by Nathan Sturtevant on 4/8/13.
6 // Copyright (c) 2013 University of Denver. All rights reserved.
7 //
8 
9 #ifndef __hog2_glut__FourBitArray__
10 #define __hog2_glut__FourBitArray__
11 
12 #include <iostream>
13 #include <stdint.h>
14 
15 // simple four-bit array with no bounds checking
17 {
18 public:
19  FourBitArray(uint64_t numEntries = 0);
20  ~FourBitArray();
21  void FillMax();
22  void Clear();
23  void Resize(uint64_t newMaxEntries);
24  uint64_t Size() const;
25  uint8_t Get(uint64_t index) const;
26  void Set(uint64_t index, uint8_t val);
27  void Write(const char *);
28  void Read(const char *);
29 private:
30  uint8_t *mem;
31  uint64_t entries;
32 };
33 
34 #endif /* defined(__hog2_glut__FourBitArray__) */
FourBitArray
Definition: FourBitArray.h:16
FourBitArray::Size
uint64_t Size() const
Definition: FourBitArray.cpp:47
FourBitArray::Set
void Set(uint64_t index, uint8_t val)
Definition: FourBitArray.cpp:62
FourBitArray::Clear
void Clear()
Definition: FourBitArray.cpp:34
FourBitArray::Get
uint8_t Get(uint64_t index) const
Definition: FourBitArray.cpp:52
FourBitArray::Resize
void Resize(uint64_t newMaxEntries)
Definition: FourBitArray.cpp:39
FourBitArray::Write
void Write(const char *)
Definition: FourBitArray.cpp:73
FourBitArray::entries
uint64_t entries
Definition: FourBitArray.h:31
FourBitArray::mem
uint8_t * mem
Definition: FourBitArray.h:30
FourBitArray::FillMax
void FillMax()
Definition: FourBitArray.cpp:29
FourBitArray::Read
void Read(const char *)
Definition: FourBitArray.cpp:81
FourBitArray::~FourBitArray
~FourBitArray()
Definition: FourBitArray.cpp:24
FourBitArray::FourBitArray
FourBitArray(uint64_t numEntries=0)
Definition: FourBitArray.cpp:18