diff options
author | Stephen D. Huston <shuston@apache.org> | 2011-10-21 14:42:12 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2011-10-21 14:42:12 +0000 |
commit | f83677056891e436bf5ba99e79240df2a44528cd (patch) | |
tree | 625bfd644b948e89105630759cf6decb0435354d /cpp/include/qmf | |
parent | ebfd9ff053b04ab379acfc0fefedee5a31b6d8a5 (diff) | |
download | qpid-python-QPID-2519.tar.gz |
Merged out from trunkQPID-2519
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-2519@1187375 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include/qmf')
-rw-r--r-- | cpp/include/qmf/Agent.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/AgentEvent.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/AgentSession.h | 48 | ||||
-rw-r--r-- | cpp/include/qmf/ConsoleEvent.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/ConsoleSession.h | 55 | ||||
-rw-r--r-- | cpp/include/qmf/Data.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/DataAddr.h | 5 | ||||
-rw-r--r-- | cpp/include/qmf/Handle.h | 10 | ||||
-rw-r--r-- | cpp/include/qmf/ImportExport.h | 16 | ||||
-rw-r--r-- | cpp/include/qmf/Query.h | 4 | ||||
-rw-r--r-- | cpp/include/qmf/Schema.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/SchemaId.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/SchemaMethod.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/SchemaProperty.h | 2 | ||||
-rw-r--r-- | cpp/include/qmf/Subscription.h | 4 | ||||
-rw-r--r-- | cpp/include/qmf/engine/QmfEngineImportExport.h | 9 | ||||
-rw-r--r-- | cpp/include/qmf/exceptions.h | 8 | ||||
-rw-r--r-- | cpp/include/qmf/posix/EventNotifier.h | 63 |
18 files changed, 183 insertions, 55 deletions
diff --git a/cpp/include/qmf/Agent.h b/cpp/include/qmf/Agent.h index 8c0f48b8b1..94083be4f3 100644 --- a/cpp/include/qmf/Agent.h +++ b/cpp/include/qmf/Agent.h @@ -42,7 +42,7 @@ namespace qmf { class SchemaId; class Schema; - class Agent : public qmf::Handle<AgentImpl> { + class QMF_CLASS_EXTERN Agent : public qmf::Handle<AgentImpl> { public: QMF_EXTERN Agent(AgentImpl* impl = 0); QMF_EXTERN Agent(const Agent&); diff --git a/cpp/include/qmf/AgentEvent.h b/cpp/include/qmf/AgentEvent.h index 59a41c3267..0f93a9bb0a 100644 --- a/cpp/include/qmf/AgentEvent.h +++ b/cpp/include/qmf/AgentEvent.h @@ -46,7 +46,7 @@ namespace qmf { AGENT_THREAD_FAILED = 8 }; - class AgentEvent : public qmf::Handle<AgentEventImpl> { + class QMF_CLASS_EXTERN AgentEvent : public qmf::Handle<AgentEventImpl> { public: QMF_EXTERN AgentEvent(AgentEventImpl* impl = 0); QMF_EXTERN AgentEvent(const AgentEvent&); diff --git a/cpp/include/qmf/AgentSession.h b/cpp/include/qmf/AgentSession.h index 9e29d6b54b..589d364bcc 100644 --- a/cpp/include/qmf/AgentSession.h +++ b/cpp/include/qmf/AgentSession.h @@ -40,7 +40,7 @@ namespace qmf { class Data; class DataAddr; - class AgentSession : public qmf::Handle<AgentSessionImpl> { + class QMF_CLASS_EXTERN AgentSession : public qmf::Handle<AgentSessionImpl> { public: QMF_EXTERN AgentSession(AgentSessionImpl* impl = 0); QMF_EXTERN AgentSession(const AgentSession&); @@ -71,15 +71,20 @@ namespace qmf { * If False: Listen only on the routable direct address * strict-security:{True,False} - If True: Cooperate with the broker to enforce strict access control to the network * - If False: Operate more flexibly with regard to use of messaging facilities [default] + * max-thread-wait-time:N - Time (in seconds) the session thread will wait for messages from the network between + * periodic background processing passes. [default: 5] + * Must not be greater than 'interval'. Larger numbers will cause fewer wake-ups but will + * increase the time it takes to shut down the process. This setting will not affect the + * agent's response time for queries or method invocation. */ - QMF_EXTERN AgentSession(qpid::messaging::Connection&, const std::string& options=""); + QMF_EXTERN AgentSession(qpid::messaging::Connection& conn, const std::string& options=""); /** * setDomain - Change the QMF domain that this agent will operate in. If this is not called, * the domain will be "default". Agents in a domain can be seen only by consoles in the same domain. * This must be called prior to opening the agent session. */ - QMF_EXTERN void setDomain(const std::string&); + QMF_EXTERN void setDomain(const std::string& domain); /** * Set identifying attributes of this agent. @@ -88,16 +93,16 @@ namespace qmf { * setInstance - Set the unique instance name (if not set, a UUID will be assigned) * These must be called prior to opening the agent session. */ - QMF_EXTERN void setVendor(const std::string&); - QMF_EXTERN void setProduct(const std::string&); - QMF_EXTERN void setInstance(const std::string&); + QMF_EXTERN void setVendor(const std::string& vendor); + QMF_EXTERN void setProduct(const std::string& product); + QMF_EXTERN void setInstance(const std::string& instance); /** * setAttribute - Set an arbitrary attribute for this agent. The attributes are not used * to uniquely identify the agent but can be used as a search criteria when looking for agents. * This must be called prior to opening the agent session. */ - QMF_EXTERN void setAttribute(const std::string&, const qpid::types::Variant&); + QMF_EXTERN void setAttribute(const std::string& key, const qpid::types::Variant& value); /** * Get the identifying name of the agent. @@ -119,13 +124,19 @@ namespace qmf { * Get the next event from the agent session. Events represent actions that must be acted upon by the * agent application. This method blocks for up to the timeout if there are no events to be handled. * This method will typically be the focus of the agent application's main execution loop. + * If the timeout is set to Duration::IMMEDIATE, the call will not block. */ - QMF_EXTERN bool nextEvent(AgentEvent&, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER); + QMF_EXTERN bool nextEvent(AgentEvent& outEvent, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER); + + /** + * Return the number of events pending for nextEvent. This method will never block. + */ + QMF_EXTERN int pendingEvents() const; /** * Register a schema to be exposed by this agent. */ - QMF_EXTERN void registerSchema(Schema&); + QMF_EXTERN void registerSchema(Schema& schema); /** * Add data to be managed internally by the agent. If the option external:True is selected, this call @@ -138,12 +149,12 @@ namespace qmf { * across different sessions. If persistent, it is the agent application's * responsibility to ensure the name is the same each time it is added. */ - QMF_EXTERN DataAddr addData(Data&, const std::string& name="", bool persistent=false); + QMF_EXTERN DataAddr addData(Data& data, const std::string& name="", bool persistent=false); /** * Delete data from internal agent management. */ - QMF_EXTERN void delData(const DataAddr&); + QMF_EXTERN void delData(const DataAddr& dataAddr); /** * The following methods are used to respond to events received in nextEvent. @@ -155,13 +166,13 @@ namespace qmf { * complete - Indicate that the response to a query is complete (external:True only) * methodSuccess - Indicate the successful completion of a method call. */ - QMF_EXTERN void authAccept(AgentEvent&); - QMF_EXTERN void authReject(AgentEvent&, const std::string& diag=""); - QMF_EXTERN void raiseException(AgentEvent&, const std::string&); - QMF_EXTERN void raiseException(AgentEvent&, const Data&); - QMF_EXTERN void response(AgentEvent&, const Data&); - QMF_EXTERN void complete(AgentEvent&); - QMF_EXTERN void methodSuccess(AgentEvent&); + QMF_EXTERN void authAccept(AgentEvent& event); + QMF_EXTERN void authReject(AgentEvent& event, const std::string& diag=""); + QMF_EXTERN void raiseException(AgentEvent& event, const std::string& errorText); + QMF_EXTERN void raiseException(AgentEvent& event, const Data& errorData); + QMF_EXTERN void response(AgentEvent& event, const Data& responseData); + QMF_EXTERN void complete(AgentEvent& event); + QMF_EXTERN void methodSuccess(AgentEvent& event); /** * Raise an event to be sent into the QMF network. @@ -177,6 +188,7 @@ namespace qmf { #ifndef SWIG private: friend class qmf::PrivateImplRef<AgentSession>; + friend struct AgentSessionImplAccess; #endif }; diff --git a/cpp/include/qmf/ConsoleEvent.h b/cpp/include/qmf/ConsoleEvent.h index b836b629af..94600f9357 100644 --- a/cpp/include/qmf/ConsoleEvent.h +++ b/cpp/include/qmf/ConsoleEvent.h @@ -57,7 +57,7 @@ namespace qmf { AGENT_DEL_FILTER = 2 }; - class ConsoleEvent : public qmf::Handle<ConsoleEventImpl> { + class QMF_CLASS_EXTERN ConsoleEvent : public qmf::Handle<ConsoleEventImpl> { public: QMF_EXTERN ConsoleEvent(ConsoleEventImpl* impl = 0); QMF_EXTERN ConsoleEvent(const ConsoleEvent&); diff --git a/cpp/include/qmf/ConsoleSession.h b/cpp/include/qmf/ConsoleSession.h index 0c73e7a6db..022485cfa7 100644 --- a/cpp/include/qmf/ConsoleSession.h +++ b/cpp/include/qmf/ConsoleSession.h @@ -38,7 +38,7 @@ namespace qmf { class ConsoleSessionImpl; class ConsoleEvent; - class ConsoleSession : public qmf::Handle<ConsoleSessionImpl> { + class QMF_CLASS_EXTERN ConsoleSession : public qmf::Handle<ConsoleSessionImpl> { public: QMF_EXTERN ConsoleSession(ConsoleSessionImpl* impl = 0); QMF_EXTERN ConsoleSession(const ConsoleSession&); @@ -61,15 +61,53 @@ namespace qmf { * If False: Listen only on the routable direct address * strict-security:{True,False} - If True: Cooperate with the broker to enforce strict access control to the network * - If False: Operate more flexibly with regard to use of messaging facilities [default] + * max-thread-wait-time:N - Time (in seconds) the session thread will wait for messages from the network between + * periodic background processing passes. + * Must not be greater than 60. Larger numbers will cause fewer wake-ups but will + * increase the time it takes to shut down the process. [default: 5] + */ + QMF_EXTERN ConsoleSession(qpid::messaging::Connection& conn, const std::string& options=""); + + /** + * setDomain - Change the QMF domain that this console will operate in. If this is not called, + * the domain will be "default". Agents in a domain can be seen only by consoles in the same domain. + * This must be called prior to opening the console session. + */ + QMF_EXTERN void setDomain(const std::string& domain); + QMF_EXTERN void setAgentFilter(const std::string& filter); + + /** + * Open the console session. After opening the session, the domain cannot be changed. */ - QMF_EXTERN ConsoleSession(qpid::messaging::Connection&, const std::string& options=""); - QMF_EXTERN void setDomain(const std::string&); - QMF_EXTERN void setAgentFilter(const std::string&); QMF_EXTERN void open(); + + /** + * Close the session. Once closed, the session no longer communicates on the messaging network. + */ QMF_EXTERN void close(); - QMF_EXTERN bool nextEvent(ConsoleEvent&, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER); + + /** + * Get the next event from the console session. Events represent actions that must be acted upon by the + * console application. This method blocks for up to the timeout if there are no events to be handled. + * This method will typically be the focus of the console application's main execution loop. + * If the timeout is set to Duration::IMMEDIATE, the call will not block. + */ + QMF_EXTERN bool nextEvent(ConsoleEvent& outEvent, qpid::messaging::Duration timeout=qpid::messaging::Duration::FOREVER); + + /** + * Return the number of events pending for nextEvent. This method will never block. + */ + QMF_EXTERN int pendingEvents() const; + + /** + * getAgentCount, getAgent - Retrieve the set of agents that match the console session's agent filter. + */ QMF_EXTERN uint32_t getAgentCount() const; - QMF_EXTERN Agent getAgent(uint32_t) const; + QMF_EXTERN Agent getAgent(uint32_t agentIndex) const; + + /** + * Get the agent for the connected broker (i.e. the agent embedded in the broker to which we have a connection). + */ QMF_EXTERN Agent getConnectedBrokerAgent() const; /** @@ -79,12 +117,13 @@ namespace qmf { * will involve all known agents. If agentFilter is non-empty, it will be applied only to the set of known * agents. A subscription cannot be created that involves an agent not known by the session. */ - QMF_EXTERN Subscription subscribe(const Query&, const std::string& agentFilter = "", const std::string& options = ""); - QMF_EXTERN Subscription subscribe(const std::string&, const std::string& agentFilter = "", const std::string& options = ""); + QMF_EXTERN Subscription subscribe(const Query& query, const std::string& agentFilter = "", const std::string& options = ""); + QMF_EXTERN Subscription subscribe(const std::string& query, const std::string& agentFilter = "", const std::string& options = ""); #ifndef SWIG private: friend class qmf::PrivateImplRef<ConsoleSession>; + friend struct ConsoleSessionImplAccess; #endif }; diff --git a/cpp/include/qmf/Data.h b/cpp/include/qmf/Data.h index 82f1569a0b..487a02fe95 100644 --- a/cpp/include/qmf/Data.h +++ b/cpp/include/qmf/Data.h @@ -39,7 +39,7 @@ namespace qmf { class DataAddr; class Agent; - class Data : public qmf::Handle<DataImpl> { + class QMF_CLASS_EXTERN Data : public qmf::Handle<DataImpl> { public: QMF_EXTERN Data(DataImpl* impl = 0); QMF_EXTERN Data(const Data&); diff --git a/cpp/include/qmf/DataAddr.h b/cpp/include/qmf/DataAddr.h index 72de0c986a..20c469081e 100644 --- a/cpp/include/qmf/DataAddr.h +++ b/cpp/include/qmf/DataAddr.h @@ -34,7 +34,7 @@ namespace qmf { class DataAddrImpl; - class DataAddr : public qmf::Handle<DataAddrImpl> { + class QMF_CLASS_EXTERN DataAddr : public qmf::Handle<DataAddrImpl> { public: QMF_EXTERN DataAddr(DataAddrImpl* impl = 0); QMF_EXTERN DataAddr(const DataAddr&); @@ -51,6 +51,9 @@ namespace qmf { QMF_EXTERN uint32_t getAgentEpoch() const; QMF_EXTERN qpid::types::Variant::Map asMap() const; + QMF_EXTERN bool operator==(const DataAddr&) const; + QMF_EXTERN bool operator<(const DataAddr&) const; + #ifndef SWIG private: friend class qmf::PrivateImplRef<DataAddr>; diff --git a/cpp/include/qmf/Handle.h b/cpp/include/qmf/Handle.h index 510e2993aa..50971ea626 100644 --- a/cpp/include/qmf/Handle.h +++ b/cpp/include/qmf/Handle.h @@ -39,22 +39,22 @@ template <class T> class Handle { public: /**@return true if handle is valid, i.e. not null. */ - QMF_EXTERN bool isValid() const { return impl; } + QMF_INLINE_EXTERN bool isValid() const { return impl; } /**@return true if handle is null. It is an error to call any function on a null handle. */ - QMF_EXTERN bool isNull() const { return !impl; } + QMF_INLINE_EXTERN bool isNull() const { return !impl; } /** Conversion to bool supports idiom if (handle) { handle->... } */ - QMF_EXTERN operator bool() const { return impl; } + QMF_INLINE_EXTERN operator bool() const { return impl; } /** Operator ! supports idiom if (!handle) { do_if_handle_is_null(); } */ - QMF_EXTERN bool operator !() const { return !impl; } + QMF_INLINE_EXTERN bool operator !() const { return !impl; } void swap(Handle<T>& h) { T* t = h.impl; h.impl = impl; impl = t; } protected: typedef T Impl; - QMF_EXTERN Handle() :impl() {} + QMF_INLINE_EXTERN Handle() :impl() {} // Not implemented,subclasses must implement. QMF_EXTERN Handle(const Handle&); diff --git a/cpp/include/qmf/ImportExport.h b/cpp/include/qmf/ImportExport.h index f5e1d9127c..7405c15259 100644 --- a/cpp/include/qmf/ImportExport.h +++ b/cpp/include/qmf/ImportExport.h @@ -20,14 +20,16 @@ * under the License. */ -#if defined(WIN32) && !defined(QPID_DECLARE_STATIC) -# if defined(QMF_EXPORT) || defined (qmfcommon_EXPORTS) -# define QMF_EXTERN __declspec(dllexport) -# else -# define QMF_EXTERN __declspec(dllimport) -# endif +#include "qpid/ImportExport.h" + +#if defined(QMF_EXPORT) || defined (qmf2_EXPORTS) +# define QMF_EXTERN QPID_EXPORT +# define QMF_CLASS_EXTERN QPID_CLASS_EXPORT +# define QMF_INLINE_EXTERN QPID_INLINE_EXPORT #else -# define QMF_EXTERN +# define QMF_EXTERN QPID_IMPORT +# define QMF_CLASS_EXTERN QPID_CLASS_IMPORT +# define QMF_INLINE_EXTERN QPID_INLINE_IMPORT #endif #endif diff --git a/cpp/include/qmf/Query.h b/cpp/include/qmf/Query.h index fec4660bd7..c1264f8901 100644 --- a/cpp/include/qmf/Query.h +++ b/cpp/include/qmf/Query.h @@ -43,7 +43,7 @@ namespace qmf { QUERY_SCHEMA_ID = 4 }; - class Query : public qmf::Handle<QueryImpl> { + class QMF_CLASS_EXTERN Query : public qmf::Handle<QueryImpl> { public: QMF_EXTERN Query(QueryImpl* impl = 0); QMF_EXTERN Query(const Query&); @@ -65,7 +65,7 @@ namespace qmf { #ifndef SWIG private: friend class qmf::PrivateImplRef<Query>; - friend class QueryImplAccess; + friend struct QueryImplAccess; #endif }; diff --git a/cpp/include/qmf/Schema.h b/cpp/include/qmf/Schema.h index cf316138c1..6cfd2e2a56 100644 --- a/cpp/include/qmf/Schema.h +++ b/cpp/include/qmf/Schema.h @@ -38,7 +38,7 @@ namespace qmf { class SchemaProperty; class SchemaMethod; - class Schema : public qmf::Handle<SchemaImpl> { + class QMF_CLASS_EXTERN Schema : public qmf::Handle<SchemaImpl> { public: QMF_EXTERN Schema(SchemaImpl* impl = 0); QMF_EXTERN Schema(const Schema&); diff --git a/cpp/include/qmf/SchemaId.h b/cpp/include/qmf/SchemaId.h index 13fb1cb902..2dafc1c091 100644 --- a/cpp/include/qmf/SchemaId.h +++ b/cpp/include/qmf/SchemaId.h @@ -35,7 +35,7 @@ namespace qmf { class SchemaIdImpl; - class SchemaId : public qmf::Handle<SchemaIdImpl> { + class QMF_CLASS_EXTERN SchemaId : public qmf::Handle<SchemaIdImpl> { public: QMF_EXTERN SchemaId(SchemaIdImpl* impl = 0); QMF_EXTERN SchemaId(const SchemaId&); diff --git a/cpp/include/qmf/SchemaMethod.h b/cpp/include/qmf/SchemaMethod.h index 47302b62b9..b5944dc29e 100644 --- a/cpp/include/qmf/SchemaMethod.h +++ b/cpp/include/qmf/SchemaMethod.h @@ -36,7 +36,7 @@ namespace qmf { class SchemaMethodImpl; class SchemaProperty; - class SchemaMethod : public qmf::Handle<SchemaMethodImpl> { + class QMF_CLASS_EXTERN SchemaMethod : public qmf::Handle<SchemaMethodImpl> { public: QMF_EXTERN SchemaMethod(SchemaMethodImpl* impl = 0); QMF_EXTERN SchemaMethod(const SchemaMethod&); diff --git a/cpp/include/qmf/SchemaProperty.h b/cpp/include/qmf/SchemaProperty.h index a3a328b60b..bbb603fa50 100644 --- a/cpp/include/qmf/SchemaProperty.h +++ b/cpp/include/qmf/SchemaProperty.h @@ -36,7 +36,7 @@ namespace qmf { class SchemaPropertyImpl; - class SchemaProperty : public Handle<SchemaPropertyImpl> { + class QMF_CLASS_EXTERN SchemaProperty : public Handle<SchemaPropertyImpl> { public: QMF_EXTERN SchemaProperty(SchemaPropertyImpl* impl = 0); QMF_EXTERN SchemaProperty(const SchemaProperty&); diff --git a/cpp/include/qmf/Subscription.h b/cpp/include/qmf/Subscription.h index 4e60eb984e..398a45b922 100644 --- a/cpp/include/qmf/Subscription.h +++ b/cpp/include/qmf/Subscription.h @@ -35,7 +35,7 @@ namespace qmf { class SubscriptionImpl; class Data; - class Subscription : public qmf::Handle<SubscriptionImpl> { + class QMF_CLASS_EXTERN Subscription : public qmf::Handle<SubscriptionImpl> { public: QMF_EXTERN Subscription(SubscriptionImpl* impl = 0); QMF_EXTERN Subscription(const Subscription&); @@ -73,7 +73,7 @@ namespace qmf { #ifndef SWIG private: friend class qmf::PrivateImplRef<Subscription>; - friend class SubscriptionImplAccess; + friend struct SubscriptionImplAccess; #endif }; diff --git a/cpp/include/qmf/engine/QmfEngineImportExport.h b/cpp/include/qmf/engine/QmfEngineImportExport.h index 373617e046..cf8fffdb17 100644 --- a/cpp/include/qmf/engine/QmfEngineImportExport.h +++ b/cpp/include/qmf/engine/QmfEngineImportExport.h @@ -26,8 +26,17 @@ # else # define QMFE_EXTERN __declspec(dllimport) # endif +# ifdef _MSC_VER +# define QMFE_CLASS_EXTERN +# define QMFE_INLINE_EXTERN QMFE_EXTERN +# else +# define QMFE_CLASS_EXTERN QMFE_EXTERN +# define QMFE_INLINE_EXTERN +# endif #else # define QMFE_EXTERN +# define QMFE_CLASS_EXTERN +# define QMFE_INLINE_EXTERN #endif #endif diff --git a/cpp/include/qmf/exceptions.h b/cpp/include/qmf/exceptions.h index 7959499d63..c7ffa68ce2 100644 --- a/cpp/include/qmf/exceptions.h +++ b/cpp/include/qmf/exceptions.h @@ -31,24 +31,24 @@ namespace qmf { /** \ingroup qmf */ - struct QmfException : public qpid::types::Exception { + struct QMF_CLASS_EXTERN QmfException : public qpid::types::Exception { QMF_EXTERN QmfException(const std::string& msg); QMF_EXTERN virtual ~QmfException() throw(); qpid::types::Variant::Map detail; }; - struct KeyNotFound : public QmfException { + struct QMF_CLASS_EXTERN KeyNotFound : public QmfException { QMF_EXTERN KeyNotFound(const std::string& msg); QMF_EXTERN virtual ~KeyNotFound() throw(); }; - struct IndexOutOfRange : public QmfException { + struct QMF_CLASS_EXTERN IndexOutOfRange : public QmfException { QMF_EXTERN IndexOutOfRange(); QMF_EXTERN virtual ~IndexOutOfRange() throw(); }; - struct OperationTimedOut : public QmfException { + struct QMF_CLASS_EXTERN OperationTimedOut : public QmfException { QMF_EXTERN OperationTimedOut(); QMF_EXTERN virtual ~OperationTimedOut() throw(); }; diff --git a/cpp/include/qmf/posix/EventNotifier.h b/cpp/include/qmf/posix/EventNotifier.h new file mode 100644 index 0000000000..ebc1cb5364 --- /dev/null +++ b/cpp/include/qmf/posix/EventNotifier.h @@ -0,0 +1,63 @@ +#ifndef __QMF_POSIX_EVENT_NOTIFIER_H +#define __QMF_POSIX_EVENT_NOTIFIER_H + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include <qmf/ImportExport.h> +#include "qmf/Handle.h" +#include "qmf/AgentSession.h" +#include "qmf/ConsoleSession.h" + +namespace qmf { + + class PosixEventNotifierImpl; + class PosixEventNotifierImplAccess; + +namespace posix { + +#ifndef SWIG + template <class> class PrivateImplRef; +#endif + + class QMF_CLASS_EXTERN EventNotifier : public qmf::Handle<qmf::PosixEventNotifierImpl> { + public: + QMF_EXTERN EventNotifier(PosixEventNotifierImpl* impl = 0); + QMF_EXTERN EventNotifier(::qmf::AgentSession& agentSession); + QMF_EXTERN EventNotifier(::qmf::ConsoleSession& consoleSession); + QMF_EXTERN EventNotifier(const EventNotifier& that); + + QMF_EXTERN ~EventNotifier(); + + QMF_EXTERN EventNotifier& operator=(const EventNotifier& that); + + QMF_EXTERN int getHandle() const; + +#ifndef SWIG + private: + friend class qmf::PrivateImplRef<EventNotifier>; + friend struct qmf::PosixEventNotifierImplAccess; +#endif + + }; + +}} + +#endif + |