ObjcommEvent.cc

Go to the documentation of this file.
00001 /*
00002  * This file is part of openSDK.
00003  *
00004  * Copyright (C) 2006-2007 openSDK team
00005  *
00006  * openSDK is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; version 2.
00009  *
00010  * openSDK is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with openSDK; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  *
00019  *     $Id: ObjcommEvent.cc,v 1.5 2007/01/26 23:12:05 nuno-lopes Exp $
00020  */
00021 
00022 #include <OPENR/ObjcommEvent.h>
00023 
00024 OConnectEvent::OConnectEvent(int index, char* name, OConnectCmd command)
00025 {
00026         obsIndex_ = index;
00027         subName_  = name;
00028         command_  = command;
00029 }
00030 
00031 OConnectEvent::~OConnectEvent()
00032 {
00033         // do nothing
00034 }
00035 
00036 int OConnectEvent::ObsIndex() const
00037 {
00038         return obsIndex_;
00039 }
00040 
00041 const char* OConnectEvent::SubName() const
00042 {
00043         return subName_;
00044 }
00045 
00046 bool OConnectEvent::IsConnect() const
00047 {
00048         return (command_ == oconnectcmdCONNECT);
00049 }
00050 
00051 bool OConnectEvent::IsDisconnect() const
00052 {
00053         return (command_ != oconnectcmdCONNECT);
00054 }
00055 
00056 
00057 OControlEvent::OControlEvent(int index, char* name, ObjcommCommand command)
00058 {
00059         sbjIndex_ = index;
00060         subName_  = name;
00061         command_  = command;
00062 }
00063 
00064 OControlEvent::OControlEvent(int index, ObserverID id, char* name, ObjcommCommand command)
00065 {
00066         sbjIndex_   = index;
00067         observerID_ = id;
00068         subName_    = name;
00069         command_    = command;
00070 }
00071 
00072 OControlEvent::~OControlEvent()
00073 {
00074         // do nothing
00075 }
00076 
00077 int OControlEvent::SbjIndex() const
00078 {
00079         return sbjIndex_;
00080 }
00081 
00082 const char* OControlEvent::SubName() const
00083 {
00084         return subName_;
00085 }
00086 
00087 bool OControlEvent::IsAddObserver() const
00088 {
00089         return (command_ == objcommCMD_ADDOBSERVER || command_ == objcommCMD_ADDOBSERVER_SELF || command_ == objcommCMD_ADDOBSERVER_V22);
00090 }
00091 
00092 bool OControlEvent::IsRemoveObserver() const
00093 {
00094         return (command_ == objcommCMD_REMOVEOBSERVER || command_ == objcommCMD_REMOVEOBSERVER_SELF || command_ == objcommCMD_REMOVEOBSERVER_V22);
00095 }
00096 
00097 const ObserverID& OControlEvent::SenderID() const
00098 {
00099         return observerID_;
00100 }
00101 
00102 
00103 OReadyEvent::OReadyEvent(int index, ObserverID id, ObjcommCommand command)
00104 {
00105         sbjIndex_   = index;
00106         observerID_ = id;
00107         command_    = command;
00108 }
00109 
00110 OReadyEvent::~OReadyEvent()
00111 {
00112         // nothing to do
00113 }
00114 
00115 int OReadyEvent::SbjIndex() const
00116 {
00117         return sbjIndex_;
00118 }
00119 
00120 const ObserverID& OReadyEvent::SenderID() const
00121 {
00122         return observerID_;
00123 }
00124 
00125 bool OReadyEvent::IsAssert() const
00126 {
00127         return (command_ == objcommCMD_ASSERT_READY);
00128 }
00129 
00130 bool OReadyEvent::IsDeassert() const
00131 {
00132         return (command_ == objcommCMD_DEASSERT_READY);
00133 }
00134 
00135 
00136 const void* ONotifyEvent::Data(int i) const
00137 {
00138         return data_[i]->Base();
00139 }
00140 
00141 const void** ONotifyEvent::Data() const
00142 {
00143         return (const void**)data_;
00144 }
00145 
00146 RCRegion* ONotifyEvent::RCData(int i) const
00147 {
00148         return data_[i];
00149 }

Generated on Sun Dec 2 23:04:30 2007 for openSDK by  doxygen 1.3.9.1