All Classes Namespaces Functions Variables Enumerations Enumerator Pages
DataItem.h
1 /*
2  Copyright (c) 2014 by Elvis Angelaccio
3 
4  Permission is hereby granted, free of charge, to any person obtaining a copy
5  of this software and associated documentation files (the "Software"), to deal
6  in the Software without restriction, including without limitation the rights
7  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  copies of the Software, and to permit persons to whom the Software is
9  furnished to do so, subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in
12  all copies or substantial portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  THE SOFTWARE.
21 */
22 
23 #ifndef DATA_ITEM_H
24 #define DATA_ITEM_H
25 
26 #include <string>
27 
28 namespace entity
29 {
31  typedef enum { NECESSARY, UNNECESSARY, UNSPECIFIED_TAG } Tag;
32 
34  typedef enum { INPUT, OUTPUT, UNSPECIFIED_GROUP } Group;
35 
36 
43  class DataItem
44  {
45 
46  public:
47  DataItem();
48  DataItem(const std::string& n);
49  DataItem(const std::string& n, const std::string& f);
50  DataItem(const std::string& n, Tag t, Group g);
51  ~DataItem();
52 
53  void setName(const std::string& n);
54  void setTag(Tag t);
55  void setGroup(Group g);
56  void setFileName(const std::string& n);
57  void setOriginalSize(size_t s);
58  void setEncodedSize(size_t s);
59  void setEncoding(char *enc);
60 
61  std::string getName() const;
62  Tag getTag() const;
63  Group getGroup() const;
64  std::string getFileName() const;
65  size_t getOriginalSize() const;
66  size_t getEncodedSize() const;
67  char *getEncoding() const;
68 
70  void isPresent(bool p);
71 
73  bool isPresent() const;
74 
75  bool operator==(const DataItem& other) const;
76  bool operator!=(const DataItem& other) const;
77 
78  private:
79  std::string name;
80  Tag tag;
81  Group group;
82  std::string fileName;
83  size_t originalSize;
84  size_t encodedSize;
85  char *encoding;
86  bool present;
87  };
88 
89 }
90 
91 
92 #endif
A DataItem (DI) is an object which represents a single file and is the basic unit of the SimDB system...
Definition: DataItem.h:43
Definition: DataItem.h:28
bool isPresent() const
Definition: DataItem.cpp:151