torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
generic/Renamable.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_RENAMABLE_HPP
17 #define TORC_GENERIC_RENAMABLE_HPP
18 
19 #include <string>
20 
21 //BOOST
22 #ifdef GENOM_SERIALIZATION
23 #include <boost/serialization/access.hpp>
24 #endif //GENOM_SERIALIZATION
25 namespace torc {
26 namespace generic {
27 
28 /**
29  * @brief Represents objects that can be renamed
30  *
31  * EDIF provides a way to store displayable string values with different objects using the
32  * (rename ...) construct. The Renamable interface will be generalized by objects that need to
33  * support this feature.
34  */
35 class Renamable {
36 #ifdef GENOM_SERIALIZATION
37  friend class boost::serialization::access;
38 #endif
39 public:
40  typedef std::string Name;
41 
42  /**
43  * Get the new name provided for the object.
44  *
45  * @return Name of the object
46  */
47  inline virtual Name getOriginalName() const;
48 
49  /**
50  * Set the new name provided for the object.
51  *
52  * @param[in] inSource Name of the object
53  */
54  virtual void setOriginalName(const Name& inSource);
55 
56 protected:
57  Renamable();
58 
59 public:
60  virtual ~Renamable() throw ();
61 
62 private:
63  Renamable(const Renamable&);
64  Renamable& operator =(const Renamable&);
65 
66 private:
67 #ifdef GENOM_SERIALIZATION
68  template <class Archive> void serialize(Archive& ar, unsigned int);
69 #endif //GENOM_SERIALIZATION
71 };
72 
73 /**
74  * Get the new name provided for the object.
75  *
76  * @return Name of the object
77  */
79  return mOriginalName;
80 }
81 
82 } // namespace generic
83 } // namespace torc
84 
85 #endif // TORC_GENERIC_RENAMABLE_HPP
std::string string
virtual void setOriginalName(const Name &inSource)
Represents objects that can be renamed.
virtual Name getOriginalName() const