00001 /* 00002 FALCON - The Falcon Programming Language. 00003 FILE: vmmsg.h 00004 00005 Asynchronous message for the Virtual Machine. 00006 ------------------------------------------------------------------- 00007 Author: Giancarlo Niccolai 00008 Begin: Sun, 08 Feb 2009 16:08:50 +0100 00009 00010 ------------------------------------------------------------------- 00011 (C) Copyright 2009: the FALCON developers (see list in AUTHORS file) 00012 00013 See LICENSE file for licensing details. 00014 */ 00015 00016 #ifndef FLC_VMMSG_H 00017 #define FLC_VMMSG_H 00018 00023 #include <falcon/setup.h> 00024 #include <falcon/basealloc.h> 00025 #include <falcon/string.h> 00026 #include <falcon/item.h> 00027 00028 namespace Falcon { 00029 00030 class GarbageLock; 00031 class VMachine; 00032 class Error; 00033 00047 class FALCON_DYN_CLASS VMMessage: public BaseAlloc 00048 { 00049 String m_msg; 00050 SafeItem *m_params; 00051 uint32 m_allocated; 00052 uint32 m_pcount; 00053 VMMessage *m_next; 00054 Error* m_error; 00055 00056 public: 00060 VMMessage( const String &msgName ); 00061 00062 virtual ~VMMessage(); 00063 00065 const String& name() const { return m_msg; } 00066 00070 void addParam( const SafeItem &itm ); 00071 00073 uint32 paramCount() const {return m_pcount;} 00074 00076 SafeItem *param( uint32 p ) const; 00077 00093 virtual void onMsgComplete( bool bProcessed ); 00094 00101 void append( VMMessage *msg ) { m_next = msg; } 00102 00106 VMMessage *next() const { return m_next; } 00107 00111 void error( Error* err ); 00112 00114 Error* error() const { return m_error; } 00115 }; 00116 00117 } 00118 00119 #endif 00120 00121 /* end of vmmsg.h */