00001 00009 #ifndef RAZORBACK_QUEUE_H 00010 #define RAZORBACK_QUEUE_H 00011 #include <razorback/visibility.h> 00012 #include <razorback/types.h> 00013 #include <razorback/socket.h> 00014 #include <razorback/lock.h> 00015 00016 #ifdef __cplusplus 00017 extern "C" { 00018 #endif 00019 00020 #define COMMAND_QUEUE "/topic/COMMAND" 00021 #define REQUEST_QUEUE "/queue/REQUEST" 00022 #define LOG_QUEUE "/queue/LOG" 00023 #define INPUT_QUEUE "/queue/INPUT" 00024 #define JUDGMENT_QUEUE "/queue/JUDGMENT" 00025 00029 struct Queue 00030 { 00031 struct Socket *pReadSocket; 00032 struct Socket *pWriteSocket; 00033 char *sName; 00034 int iFlags; 00035 int mode; 00036 struct Mutex *mReadMutex; 00037 struct Mutex *mWriteMutex; 00038 }; 00039 00040 #define QUEUE_FLAG_SEND 0x01 00041 #define QUEUE_FLAG_RECV 0x02 00042 00048 SO_PUBLIC extern struct Queue *Queue_Create (const char * p_sQueueName, 00049 int p_iFlags, int mode); 00050 00054 SO_PUBLIC extern void Queue_Terminate (struct Queue *p_pQ); 00055 00061 SO_PUBLIC extern struct Message *Queue_Get (struct Queue *queue); 00062 00068 SO_PUBLIC extern bool Queue_Put_Dest (struct Queue *queue, struct Message *message, char *dest); 00069 SO_PUBLIC extern bool Queue_Put (struct Queue *queue, struct Message *message); 00070 00076 SO_PUBLIC extern void Queue_GetQueueName (const char * p_sLeading, 00077 uuid_t p_pId, char * p_sQueueName); 00078 #ifdef __cplusplus 00079 } 00080 #endif 00081 #endif // RAZORBACK_QUEUE_H