torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UserDataContainer.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_USERDATACONTAINER_HPP
17 #define TORC_GENERIC_USERDATACONTAINER_HPP
18 
19 #include <iostream>
20 #include <string>
21 #include <list>
22 
23 #include "torc/generic/Error.hpp"
24 
25 namespace torc { namespace generic { class BaseVisitor; } }
26 
27 namespace torc {
28 namespace generic {
29 
30 /**
31  * @brief Represents class that can hold userData
32  *
33  * The UserDataContainer interface is generalized by classes that need to hold one or more userData.
34  */
36 
37 public:
38 
39  /**
40  * Get the list of all userData
41  *
42  * @param[out] outUserData The list of all userData
43  */
44  inline void getUserData(std::list<std::string>& outUserData) const;
45 
46  /**
47  * Set the list of userData
48  *
49  * @param[in] inSource The list of UserData
50  */
51  void setUserData(const std::list<std::string>& inSource);
52 
53  /**
54  * Add an user data to the list of user data
55  * @param[in] inSource An user data as string
56  */
57  void addUserData(const std::string& inSource);
58 
59 protected:
61 
62 public:
63  ~UserDataContainer() throw ();
64 
65 private:
66  UserDataContainer(const UserDataContainer& source);
67 
69 
70  std::list<std::string> mUserData;
71 };
72 
73 /**
74  * Get the list of all userData
75  *
76  * @param[out] outUserData The list of all userData
77  */
78 inline void UserDataContainer::getUserData(std::list<std::string>& outUserData) const {
79  outUserData.insert(outUserData.end(), mUserData.begin(), mUserData.end());
80  return;
81 }
82 
83 } // namespace generic
84 } // namespace torc
85 
86 #endif // TORC_GENERIC_USERDATACONTAINER_HPP
Represents class that can hold userData.
std::string string
void setUserData(const std::list< std::string > &inSource)
std::list< std::string > mUserData
void getUserData(std::list< std::string > &outUserData) const
UserDataContainer & operator=(const UserDataContainer &source)
void addUserData(const std::string &inSource)