00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/generic/om/StatusContainer.cpp $ 00003 // $Id: StatusContainer.cpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 #include "torc/generic/om/StatusContainer.hpp" 00017 #include "torc/generic/om/Status.hpp" 00018 00019 namespace torc { 00020 00021 namespace generic { 00022 00023 StatusContainer::StatusContainer() 00024 :mStatuses() { 00025 } 00026 00027 StatusContainer::~StatusContainer() throw() { 00028 } 00029 00030 /** 00031 * Set a vector of pointer to Status object 00032 * 00033 * @param[in] inStatus The vector of pointer to Status object 00034 */ 00035 void 00036 StatusContainer::setStatuses(const std::vector< StatusSharedPtr > & inStatus) throw() { 00037 std::vector< StatusSharedPtr >::const_iterator it = inStatus.begin(); 00038 for( ; it != inStatus.end(); it++ ) { 00039 mStatuses.push_back( *it ); 00040 } 00041 } 00042 00043 /** 00044 * Add a status to the list of statuses. If an empty pointer is supplied, 00045 * it returns without doing anything. 00046 * 00047 * @param[in] inStatus A pointer to a status object. 00048 * 00049 * @exception Error Status could not be added. 00050 */ 00051 void 00052 StatusContainer::addStatus(const StatusSharedPtr & inStatus) throw(Error) { 00053 mStatuses.push_back( inStatus ); 00054 } 00055 00056 } // namespace torc::generic 00057 00058 } // namespace torc