Small style stuff
[zxing.git] / cpp / core / src / zxing / datamatrix / Version.h
1 #ifndef __VERSION_H__
2 #define __VERSION_H__
3
4 /*
5  *  Version.h
6  *  zxing
7  *
8  *  Created by Luiz Silva on 09/02/2010.
9  *  Copyright 2010 ZXing authors All rights reserved.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23
24 #include <zxing/ReaderException.h>
25 #include <zxing/common/BitMatrix.h>
26 #include <zxing/common/Counted.h>
27 #include <vector>
28
29 namespace zxing {
30 namespace datamatrix {
31
32 class ECB {
33 private:
34   int count_;
35   int dataCodewords_;
36 public:
37   ECB(int count, int dataCodewords);
38   int getCount();
39   int getDataCodewords();
40 };
41
42 class ECBlocks {
43 private:
44   int ecCodewords_;
45   std::vector<ECB*> ecBlocks_;
46 public:
47   ECBlocks(int ecCodewords, ECB *ecBlocks);
48   ECBlocks(int ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2);
49   int getECCodewords();
50   std::vector<ECB*>& getECBlocks();
51   ~ECBlocks();
52 };
53
54 class Version : public Counted {
55 private:
56   int versionNumber_;
57   int symbolSizeRows_;
58   int symbolSizeColumns_;
59   int dataRegionSizeRows_;
60   int dataRegionSizeColumns_;
61   ECBlocks* ecBlocks_;
62   int totalCodewords_;
63   Version(int versionNumber, int symbolSizeRows, int symbolSizeColumns, int dataRegionSizeRows,
64                   int dataRegionSizeColumns, ECBlocks *ecBlocks);
65
66 public:
67   static std::vector<Ref<Version> > VERSIONS;
68   
69   ~Version();
70   int getVersionNumber();
71   int getSymbolSizeRows();
72   int getSymbolSizeColumns();  
73   int getDataRegionSizeRows();  
74   int getDataRegionSizeColumns();
75   int getTotalCodewords();
76   ECBlocks* getECBlocks();
77   static int  buildVersions();  
78   Ref<Version> getVersionForDimensions(int numRows, int numColumns);
79   
80 private:
81   Version(const Version&);
82   Version & operator=(const Version&);
83 };
84 }
85 }
86
87 #endif // __VERSION_H__