00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "torc/generic/om/Status.hpp"
00017
00018 namespace torc {
00019
00020 namespace generic {
00021
00022
00023
00024
00025
00026
00027
00028
00029 StatusSharedPtr
00030 Status::Factory::newStatusPtr(
00031 const StatusContainerSharedPtr & inContainer ) throw(Error) {
00032 try
00033 {
00034 StatusSharedPtr newStatus;
00035 create( newStatus );
00036 inContainer->addStatus( newStatus );
00037 return newStatus;
00038 }
00039 catch( Error &e )
00040 {
00041 e.setCurrentLocation(
00042 __FUNCTION__, __FILE__, __LINE__ );
00043 throw;
00044 }
00045 }
00046
00047 Status::Status()
00048 :Commentable(),
00049 Visitable(),
00050 UserDataContainer(),
00051 SelfReferencing<Status>(),
00052 mWrittens() {
00053 }
00054
00055 Status::~Status() throw() {
00056 }
00057
00058
00059
00060
00061
00062
00063 void
00064 Status::setWrittens( const std::vector< WrittenSharedPtr > &inSource ) throw() {
00065 std::vector< WrittenSharedPtr >::const_iterator it = inSource.begin();
00066 for( ; it != inSource.end(); it++ ) {
00067 mWrittens.push_back( *it );
00068 }
00069 }
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 void
00080 Status::addWritten(WrittenSharedPtr & inWritten) throw(Error) {
00081 mWrittens.push_back( inWritten );
00082 }
00083
00084 void
00085 Status::accept(BaseVisitor & visitor) throw(Error) {
00086 try
00087 {
00088 runVisitor( *this, visitor );
00089 }
00090 catch( Error &e )
00091 {
00092 e.setCurrentLocation(
00093 __FUNCTION__, __FILE__, __LINE__ );
00094 throw;
00095 }
00096 }
00097
00098 }
00099
00100 }