diff options
| author | Ted Ross <tross@apache.org> | 2008-12-23 19:38:25 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2008-12-23 19:38:25 +0000 |
| commit | 12d7d4125a42a7f0ab26a89c3c34e88135cf5869 (patch) | |
| tree | 5970de22eb3027833688156a4116d71ef6b44442 /cpp/src/qpid/console/SessionManager.h | |
| parent | 912a6db37456524c60e1b7f3236de4dca3c77636 (diff) | |
| download | qpid-python-12d7d4125a42a7f0ab26a89c3c34e88135cf5869.tar.gz | |
QPID-1412 Updates and fixes for the c++ console API:
- Added event support
- Converted raw pointers to shared_ptrs in references to Values.
This fixes a memory leak in the original code.
- Added wrappers to make value access more convenient.
- Added timeout handling for synchronous operations.
Timeout values are configurable.
- Fixed a bug in getObjects whereby waitForStable was not called and
the operation could fail if called too early.
- Added examples "printevents" and "ping" to illustrate the usage of
different aspects of the API.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@729075 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/console/SessionManager.h')
| -rw-r--r-- | cpp/src/qpid/console/SessionManager.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/cpp/src/qpid/console/SessionManager.h b/cpp/src/qpid/console/SessionManager.h index 3da6f98c86..27df00494c 100644 --- a/cpp/src/qpid/console/SessionManager.h +++ b/cpp/src/qpid/console/SessionManager.h @@ -30,6 +30,7 @@ #include "Agent.h" #include "Object.h" #include "ObjectId.h" +#include "Value.h" #include "qpid/sys/Mutex.h" #include "qpid/sys/Condition.h" #include "qpid/client/ConnectionSettings.h" @@ -52,6 +53,19 @@ class SessionManager typedef std::vector<ClassKey> KeyVector; ~SessionManager() {} + struct Settings { + bool rcvObjects; + bool rcvEvents; + bool rcvHeartbeats; + bool userBindings; + uint32_t methodTimeout; + uint32_t getTimeout; + + Settings() : rcvObjects(true), rcvEvents(true), rcvHeartbeats(true), userBindings(false), + methodTimeout(20), getTimeout(20) + {} + }; + /** Create a new SessionManager * * Provide your own subclass of ConsoleListener to receive updates and indications @@ -61,24 +75,18 @@ class SessionManager *@param rcvObjects Listener wishes to receive managed object data. *@param rcvEvents Listener wishes to receive events. *@param rcvHeartbeats Listener wishes to receive agent heartbeats. - *@param manageConnections SessionManager should retry dropped connections. *@param userBindings If rcvObjects is true, userBindings allows the console client * to control which object classes are received. See the bindPackage and bindClass * methods. If userBindings is false, the listener will receive updates for all * object classes. */ SessionManager(ConsoleListener* listener = 0, - bool rcvObjects = true, - bool rcvEvents = true, - bool rcvHeartbeats = true, - bool manageConnections = false, - bool userBindings = false); + Settings settings = Settings()); /** Connect a broker to the console session * *@param settings Connection settings for client access *@return broker object if operation is successful - *@exception If 'manageConnections' is disabled and the connection to the broker fails, * an exception shall be thrown. */ Broker* addBroker(client::ConnectionSettings& settings); @@ -166,11 +174,7 @@ private: SequenceManager::set syncSequenceList; Object::Vector getResult; std::string error; - bool rcvObjects; - bool rcvEvents; - bool rcvHeartbeats; - bool userBindings; - bool manageConnections; + Settings settings; NameVector bindingKeyList; void bindingKeys(); |
