torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StatusContainer.cpp
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 
17 #include "torc/generic/Status.hpp"
18 
19 namespace torc {
20 namespace generic {
21 
23  mStatuses() {}
24 
26 
27 /**
28  * Set a vector of pointer to Status object
29  *
30  * @param[in] inStatus The vector of pointer to Status object
31  */
32 void StatusContainer::setStatuses(const std::vector<StatusSharedPtr>& inStatus) {
33  std::vector<StatusSharedPtr>::const_iterator it = inStatus.begin();
34  for(; it != inStatus.end(); it++) {
35  mStatuses.push_back(*it);
36  }
37 }
38 
39 /**
40  * Add a status to the list of statuses. If an empty pointer is supplied,
41  * it returns without doing anything.
42  *
43  * @param[in] inStatus A pointer to a status object.
44  *
45  * @exception Error Status could not be added.
46  */
47 void StatusContainer::addStatus(const StatusSharedPtr& inStatus) throw (Error) {
48  mStatuses.push_back(inStatus);
49 }
50 
51 } // namespace generic
52 } // namespace torc
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
void setStatuses(const std::vector< StatusSharedPtr > &inStatus)
void addStatus(const StatusSharedPtr &inStatus)
std::vector< StatusSharedPtr > mStatuses
boost::shared_ptr< Status > StatusSharedPtr