torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Written.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef TORC_GENERIC_WRITTEN_HPP
17 #define TORC_GENERIC_WRITTEN_HPP
18 
26 
27 namespace torc {
28 namespace generic {
29 
30 /**
31  * @brief Represents an information container relating to the writer of the EDIF file
32  */
33 class Written : public Commentable, public PropertyContainer, public UserDataContainer,
34  public SelfReferencing<Written> {
35 
36  friend class FactoryType<Written> ;
37 
38 public:
39 
40  /**
41  * Convenience class to create a written.
42  */
43  class Factory : public FactoryType<Written> {
44  public:
46  /**
47  * Create a written.
48  *
49  * @param[in] inTimeStamp TimeStamp in Universal Time Coordinate.
50  * @param[in] inStatusPtr Pointer to parented(Status) object.
51  * @param[in] inAuthorName Name of the author
52  * @param[in] inProgramName Name of the program
53  * @param[in] inProgramVersion Version of the program
54  * @param[in] inDataOriginLocName Data Origin Location Name
55  * @param[in] inDataOriginVersion Version of the DataOrigin
56  *
57  * @return Pointer to created written.
58  **/
59  virtual WrittenSharedPtr
60  newWrittenPtr(const TimeStamp& inTimeStamp, const StatusSharedPtr& inStatusPtr,
61  const std::string& inAuthorName = std::string(),
62  const std::string& inProgramName = std::string(),
63  const std::string& inProgramVersion = std::string(),
64  const std::string& inDataOriginLocName = std::string(),
65  const std::string& inDataOriginVersion = std::string()) throw (Error);
66  };
67 
68  /**
69  * Get the time stamp
70  *
71  * @return mTimeStamp The time in Universal Time Coordinate (year, month, day, hour, minute,
72  * second))
73  */
74  inline const TimeStamp getTimeStamp() const;
75 
76  /**
77  * Set time stamp
78  *
79  * @param[in] inTimeStamp TimeStamp in Universal Time Coordinate.
80  */
81  void setTimeStamp(const TimeStamp& inTimeStamp);
82 
83  /**
84  * Get author name
85  *
86  * @return mAuthorName
87  */
88  inline const std::string getAuthorName() const;
89 
90  /**
91  * Set author name
92  *
93  * @param[in] inAuthorName Name of the author
94  */
95  void setAuthorName(const std::string& inAuthorName);
96 
97  /**
98  * Get program name
99  *
100  * @return mProgramName
101  */
102  inline const std::string getProgramName() const;
103 
104  /**
105  * Set program name
106  *
107  * @param[in] inProgramName Name of the program
108  */
109  void setProgramName(const std::string& inProgramName);
110 
111  /**
112  * Get program version
113  *
114  * @return mProgramVersion
115  */
116  inline const std::string getProgramVersion() const;
117 
118  /**
119  * Set program version
120  *
121  * @param[in] inProgramVersion Version of the program
122  */
123  void setProgramVersion(const std::string& inProgramVersion);
124 
125  /**
126  * Get Data origin location name
127  *
128  * @return mDataOriginLocationName
129  */
130  inline const std::string getDataOriginLocationName() const;
131 
132  /**
133  * Set Data origin location name
134  *
135  * @param[in] value Data Origin Location Name
136  */
137  void setDataOriginLocationName(const std::string& value);
138 
139  /**
140  * Get Data origin version
141  *
142  * @return mDataOriginVersion
143  */
144  inline const std::string getDataOriginVersion() const;
145 
146  /**
147  * Set Data origin version
148  *
149  * @param[in] inDataOriginVersion Version of the DataOrigin
150  */
151  void setDataOriginVersion(const std::string& inDataOriginVersion);
152 
153  Written();
154 
155  ~Written() throw ();
156 
157 private:
159  std::string mAuthorName;
160  std::string mProgramName;
161  std::string mProgramVersion;
163  std::string mDataOriginVersion;
164 
165 };
166 /**
167  * Get the time stamp
168  *
169  * @return mTimeStamp The time in Universal Time Coordinate (year, month, day, hour, minute, second))
170  */
171 inline const TimeStamp Written::getTimeStamp() const {
172  return mTimeStamp;
173 }
174 
175 /**
176  * Get author name
177  *
178  * @return mAuthorName
179  */
180 inline const std::string Written::getAuthorName() const {
181  return mAuthorName;
182 }
183 
184 /**
185  * Get program name
186  *
187  * @return mProgramName
188  */
189 inline const std::string Written::getProgramName() const {
190  return mProgramName;
191 }
192 
193 /**
194  * Get program version
195  *
196  * @return mProgramVersion
197  */
199  return mProgramVersion;
200 }
201 
202 /**
203  * Get Data origin location name
204  *
205  * @return mDataOriginLocationName
206  */
209 }
210 
211 /**
212  * Get DataOrigin version
213  *
214  * @return mDataOriginVersion
215  */
217  return mDataOriginVersion;
218 }
219 
220 } // namespace generic
221 } // namespace torc
222 
223 #endif // TORC_GENERIC_WRITTEN_HPP
Represents objects that have properties.
std::string mDataOriginLocationName
Definition: Written.hpp:162
void setProgramName(const std::string &inProgramName)
Definition: Written.cpp:81
void setDataOriginLocationName(const std::string &value)
Definition: Written.cpp:99
void setAuthorName(const std::string &inAuthorName)
Definition: Written.cpp:72
Represents all classes that can hold user comments.
Definition: Commentable.hpp:36
const TimeStamp getTimeStamp() const
Definition: Written.hpp:171
boost::shared_ptr< Written > WrittenSharedPtr
Represents class that can hold userData.
const std::string getAuthorName() const
Definition: Written.hpp:180
std::string string
void setTimeStamp(const TimeStamp &inTimeStamp)
Definition: Written.cpp:63
Represents an information container relating to the writer of the EDIF file.
Definition: Written.hpp:33
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
Represents the time in Universal Time Coordinate (year, month, day, hour, minute, second) ...
Definition: TimeStamp.hpp:29
void setDataOriginVersion(const std::string &inDataOriginVersion)
Definition: Written.cpp:108
const std::string getProgramVersion() const
Definition: Written.hpp:198
virtual WrittenSharedPtr newWrittenPtr(const TimeStamp &inTimeStamp, const StatusSharedPtr &inStatusPtr, const std::string &inAuthorName=std::string(), const std::string &inProgramName=std::string(), const std::string &inProgramVersion=std::string(), const std::string &inDataOriginLocName=std::string(), const std::string &inDataOriginVersion=std::string())
Definition: Written.cpp:35
std::string mProgramName
Definition: Written.hpp:160
const std::string getProgramName() const
Definition: Written.hpp:189
void setProgramVersion(const std::string &inProgramVersion)
Definition: Written.cpp:90
std::string mAuthorName
Definition: Written.hpp:159
boost::shared_ptr< Status > StatusSharedPtr
std::string mProgramVersion
Definition: Written.hpp:161
A placeholder for a factory method.
Definition: FactoryType.hpp:35
const std::string getDataOriginVersion() const
Definition: Written.hpp:216
const std::string getDataOriginLocationName() const
Definition: Written.hpp:207
std::string mDataOriginVersion
Definition: Written.hpp:163