1 /*----------------------------------------------------------------------------
2 Name: XmlBlasterManaged.h
3 Project: xmlBlaster.org
4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
5 Author: "Marcel Ruff" <xmlBlaster@marcelruff.info>
6 Note: A managed wrapper around the xmlBlaster client C library
7 Used for .net applications like C# or VB.net
8 See: This strange C++-CLI programming language is described in
9 http://download.microsoft.com/download/9/9/c/99c65bcd-ac66-482e-8dc1-0e14cd1670cd/C++-CLI%20Standard.pdf
10 -----------------------------------------------------------------------------*/
11 #ifndef XMLBLASTER_XmlBlasterManaged_H
12 #define XMLBLASTER_XmlBlasterManaged_H
13 #ifdef _MANAGED // If /clr flag is set
14
15 struct XmlBlasterAccessUnparsed;
16
17 namespace org { namespace xmlBlaster { namespace client {
18
19 public ref class XmlBlasterExceptionM : System::Exception
20 {
21 private:
22 const System::String ^errorCodeStr_;
23 const System::String ^embeddedMessage_;
24
25 public:
26 XmlBlasterExceptionM(const System::String^ errorCode,
27 const System::String^ embeddedMessage) {
28 this->errorCodeStr_ = errorCode;
29 this->embeddedMessage_ = embeddedMessage;
30 }
31
32 virtual ~XmlBlasterExceptionM(){};
33
34 const System::String ^getErrorCodeStr() { return this->errorCodeStr_; }
35 const System::String ^getMessage() { return this->errorCodeStr_ + this->embeddedMessage_; }
36 };
37
38
39 public ref class XmlBlasterAccessM
40 {
41 public:
42 XmlBlasterAccessM(System::Collections::Hashtable ^properties);
43 ~XmlBlasterAccessM();
44 System::String^ connect(System::String ^connectQos);
45 /*
46 org::xmlBlaster::client::qos::SubscribeReturnQos subscribe(const org::xmlBlaster::client::key::SubscribeKey& key, const org::xmlBlaster::client::qos::SubscribeQos& qos, I_Callback *callback=0);
47 std::vector<org::xmlBlaster::util::MessageUnit> get(const org::xmlBlaster::client::key::GetKey& key, const org::xmlBlaster::client::qos::GetQos& qos);
48 std::vector<org::xmlBlaster::client::qos::UnSubscribeReturnQos> unSubscribe(const org::xmlBlaster::client::key::UnSubscribeKey& key, const org::xmlBlaster::client::qos::UnSubscribeQos& qos);
49 org::xmlBlaster::client::qos::PublishReturnQos publish(const org::xmlBlaster::util::MessageUnit& msgUnit);
50 void publishOneway(const std::vector<org::xmlBlaster::util::MessageUnit>& msgUnitArr);
51 std::vector<org::xmlBlaster::client::qos::PublishReturnQos> publishArr(const std::vector<org::xmlBlaster::util::MessageUnit> &msgUnitArr);
52 std::vector<org::xmlBlaster::client::qos::EraseReturnQos> erase(const org::xmlBlaster::client::key::EraseKey& key, const org::xmlBlaster::client::qos::EraseQos& qos);
53 */
54 System::Boolean disconnect(System::String ^qos);
55 System::String^ getVersion();
56 System::String^ getUsage();
57 private:
58 void check();
59 void shutdown();
60 XmlBlasterAccessUnparsed *connection_;
61 };
62 }}}
63
64
65 #endif // _MANAGED
66 #endif /* XMLBLASTER_XmlBlasterManaged_H */
syntax highlighted by Code2HTML, v. 0.9.1