Salome HOME
FileService
[modules/gde.git] / projects / GDE_API_CPP / api / src / File.hpp
1 #ifndef GDE_FILE_HPP
2 #define GDE_FILE_HPP
3
4 #include <Poco/Timestamp.h>
5
6 #include <string>
7
8 namespace gde {
9
10   class File {
11     friend class FileService;
12     friend class GDESession;
13
14   public:
15     ~File() {}
16
17     inline int getId() const { return _id; }
18     inline void setId(int id) { this->_id = id; }
19
20     inline std::string getName() const { return _name; }
21     inline void setName(const std::string& name) { this->_name = name; }
22
23     inline int getLength() const { return _length; }
24     inline void setLength(int length) { this->_length = length; }
25
26     inline std::string getChecksum() const { return _checksum; }
27     inline void setChecksum(const std::string& checksum) { this->_checksum = checksum; }
28
29     inline Poco::Timestamp getCreationDate() const { return _creationDate; }
30     inline void setCreationDate(const Poco::Timestamp& creationDate) { this->_creationDate = creationDate; }
31
32     inline Poco::Timestamp getUpdateDate() const { return _updateDate; }
33     inline void setUpdateDate(const Poco::Timestamp& updateDate) { this->_updateDate = updateDate; }
34
35     inline bool getValid() const { return _valid; }
36     inline void setValid(bool valid) { this->_valid = valid; }
37
38     inline bool getDeleted() const { return _deleted; }
39     inline void setDeleted(bool deleted) { this->_deleted = deleted; }
40
41     inline Poco::Timestamp getDeletionDate() const { return _deletionDate; }
42     inline void setDeletionDate(const Poco::Timestamp& deletionDate) { this->_deletionDate = deletionDate; }
43
44     inline int getAttributeGroupId() const { return _attributeGroupId; }
45     inline void setAttributeGroupId(int attributeGroupId) { this->_attributeGroupId = attributeGroupId; }
46
47     inline std::string getData() const { return _data; }
48     inline void setData(const std::string& data) { this->_data = data; }
49
50     inline int getDataProfileId() const { return _dataProfileId; }
51     inline void setDataProfileId(int dataProfileId) { this->_dataProfileId = dataProfileId; }
52
53   private:
54     File(int id=-1,
55          const std::string& name="",
56          int length=-1,
57          const std::string& checksum="",
58          const Poco::Timestamp& creationDate=Poco::Timestamp(),
59          const Poco::Timestamp& updateDate=Poco::Timestamp(),
60          bool valid = false,
61          bool deleted = false,
62          const Poco::Timestamp& deletionDate=Poco::Timestamp(),
63          int attributeGroupId=-1,
64          const std::string& data="",
65          int dataProfileId=-1
66          )
67       : _id(id), _name(name), _length(length), _checksum(checksum), _creationDate(creationDate), _updateDate(updateDate), _valid(valid), _deleted(deleted), _deletionDate(deletionDate), _attributeGroupId(attributeGroupId), _data(data), _dataProfileId(dataProfileId)
68     {}
69     //File(const File&); // non copyable
70     //File& operator=(const File&); // non copyable
71
72   private:
73     int _id;
74     std::string _name;
75     int _length;
76     std::string _checksum;
77     Poco::Timestamp _creationDate;
78     Poco::Timestamp _updateDate;
79     bool _valid;
80     bool _deleted;
81     Poco::Timestamp _deletionDate;
82     int _attributeGroupId;
83     std::string _data;
84     int _dataProfileId;
85   };
86
87 };
88
89 #endif