CEL

Public API Reference

physicallayer/messaging.h
00001 /*
00002     Crystal Space Entity Layer
00003     Copyright (C) 2008 by Jorrit Tyberghein
00004   
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009   
00010     This library 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 GNU
00013     Library General Public License for more details.
00014   
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __CEL_PL_MESSAGING
00021 #define __CEL_PL_MESSAGING
00022 
00023 #include "cstypes.h"
00024 #include "csutil/scf.h"
00025 #include "csutil/set.h"
00026 #include "csutil/scfarray.h"
00027 #include "iutil/strset.h"
00028 #include "physicallayer/datatype.h"
00029 
00030 struct iCelParameterBlock;
00031 struct iMessageDispatcher;
00032 struct iMessageReceiver;
00033 struct iMessageReceiverFilter;
00034 struct iMessageSender;
00035 
00046 struct iMessageChannel : public virtual iBase
00047 {
00048   SCF_INTERFACE (iMessageChannel, 0, 0, 1);
00049 
00059   virtual csRef<iMessageDispatcher> CreateMessageDispatcher (
00060       iMessageSender* sender, const char* msg_id,
00061       iMessageReceiverFilter* receiver_filter = 0) = 0;
00062 
00069   virtual void RemoveMessageDispatcher (iMessageDispatcher* msgdest) = 0; 
00070 
00075   virtual void Subscribe (iMessageReceiver* receiver, const char* mask) = 0;
00076 
00083   virtual void Unsubscribe (iMessageReceiver* receiver,
00084     const char* mask = 0) = 0;
00085 
00101   virtual bool SendMessage (const char* msgid,
00102       iMessageSender* sender, iCelParameterBlock* params,
00103       iCelDataArray* ret = 0) = 0;
00104 };
00105 
00109 struct iMessageReceiver : public virtual iBase
00110 {
00111   SCF_INTERFACE (iMessageReceiver, 0, 0, 1);
00112 
00124   virtual bool ReceiveMessage (csStringID msg_id, iMessageSender* sender,
00125       celData& ret, iCelParameterBlock* params) = 0;
00126 };
00127 
00131 struct iMessageSender : public virtual iBase
00132 {
00133   SCF_INTERFACE (iMessageSender, 0, 0, 1);
00134 
00139   virtual void MessageDispatcherRemoved (
00140       iMessageDispatcher* dispatcher) = 0;
00141 };
00142 
00150 struct iMessageReceiverFilter : public virtual iBase
00151 {
00152   SCF_INTERFACE (iMessageReceiverFilter, 0, 0, 1);
00153 
00155   virtual bool IsValidReceiver (iMessageReceiver* receiver) = 0;
00156 };
00157 
00163 struct iMessageDispatcher : public virtual iBase
00164 {
00165   SCF_INTERFACE (iMessageDispatcher, 0, 0, 1);
00166 
00177   virtual bool SendMessage (iCelParameterBlock* params,
00178       iCelDataArray* ret = 0) = 0;
00179 };
00180 
00181 
00182 #endif // __CEL_PL_MESSAGING
00183 

Generated for CEL: Crystal Entity Layer 2.0 by doxygen 1.7.6.1