Browse Subversion Repository
Contents of /trunk/calcunits/QCalcManager.h
Parent Directory
| Revision Log
Revision 1 -
( show annotations)
( download)
( as text)
Wed Aug 3 10:14:23 2011 UTC
(12 years, 9 months ago)
by kaityo
File MIME type: text/x-chdr
File size: 1609 byte(s)
First commit
| 1 |
//--------------------------------------------------------------------------- |
| 2 |
// Management Class of QCalcUnit |
| 3 |
//--------------------------------------------------------------------------- |
| 4 |
#ifndef QCalcManagerH |
| 5 |
#define QCalcManagerH |
| 6 |
//--------------------------------------------------------------------------- |
| 7 |
#include <vector> |
| 8 |
#include <iostream> |
| 9 |
#include "QBits.h" |
| 10 |
#include "QCalcUnit.h" |
| 11 |
#include "QCompilerCntl.h" |
| 12 |
//--------------------------------------------------------------------------- |
| 13 |
class QCalcManager |
| 14 |
{ |
| 15 |
protected: |
| 16 |
int mNumberOfQBits; |
| 17 |
|
| 18 |
public: |
| 19 |
QCalcManager(void); |
| 20 |
QCalcManager(std::istream &is); |
| 21 |
~QCalcManager(); |
| 22 |
|
| 23 |
//--------------------------------------------------------------------------- |
| 24 |
// Interfaces |
| 25 |
//--------------------------------------------------------------------------- |
| 26 |
bool AddFromIntermediate(std::istream &is); |
| 27 |
void Calc(QBits * const qBits); |
| 28 |
void AddUnit(QCalcUnit *qc); |
| 29 |
int GetCalcUnitCount(void) const { |
| 30 |
return mQCalcUnits.size(); |
| 31 |
} |
| 32 |
QCalcUnit *CalcUnitAt(const int index) { |
| 33 |
return mQCalcUnits[index]; |
| 34 |
} |
| 35 |
void DeleteAll(void); |
| 36 |
int GetNumberOfQBits(void) { |
| 37 |
return mNumberOfQBits; |
| 38 |
} |
| 39 |
//void DeleteAt(const int index) {} //TODO: |
| 40 |
//--------------------------------------------------------------------------- |
| 41 |
// Utility functions |
| 42 |
//--------------------------------------------------------------------------- |
| 43 |
protected: |
| 44 |
std::vector<QCalcUnit*> mQCalcUnits; |
| 45 |
}; |
| 46 |
//--------------------------------------------------------------------------- |
| 47 |
#endif |
|