X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=include%2Fanna%2Fdiameter.comm%2FEntity.hpp;fp=include%2Fanna%2Fdiameter.comm%2FEntity.hpp;h=b8ade9be4792bccadcc0e545f3f804bafa7c4f21;hp=0dd1b90aa9ff5dccbe203563f732fb81cf51d096;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/include/anna/diameter.comm/Entity.hpp b/include/anna/diameter.comm/Entity.hpp index 0dd1b90..b8ade9b 100644 --- a/include/anna/diameter.comm/Entity.hpp +++ b/include/anna/diameter.comm/Entity.hpp @@ -75,12 +75,12 @@ private: // Availability bool a_available; // any of the servers must be bound - void availabilityLost() throw(); - void availabilityRecovered() throw(); - bool refreshAvailability() throw(); // return true if change - void assertReady() throw(anna::RuntimeException); - void initialize() throw(); - void childIdle() const throw(); + void availabilityLost() ; + void availabilityRecovered() ; + bool refreshAvailability() ; // return true if change + void assertReady() noexcept(false); + void initialize() ; + void childIdle() const ; // Selected for remove bool a_deprecated; // entity has been selected as deprecated (will be removed when idle) @@ -94,14 +94,14 @@ private: // Activity anna::Millisecond a_lastIncomingActivityTime; // last unix timestamp (in milliseconds) when message reception was managed over this entity anna::Millisecond a_lastOutgoingActivityTime; // last unix timestamp (in milliseconds) when message sending was managed over this entity - void updateIncomingActivityTime() throw(); - void updateOutgoingActivityTime() throw(); + void updateIncomingActivityTime() ; + void updateOutgoingActivityTime() ; // Private close/destroy method - void close(bool destroy) throw(anna::RuntimeException); + void close(bool destroy) noexcept(false); // helpers - static const char* asText(const SessionBasedModelsType::_v) throw(); + static const char* asText(const SessionBasedModelsType::_v) ; public: @@ -119,14 +119,14 @@ public: * * @param maxServers Maximum number of servers managed by the entity. */ - void setMaxServers(int maxServers) throw() { a_maxServers = maxServers; } + void setMaxServers(int maxServers) { a_maxServers = maxServers; } /** * Gets the maximum number of servers managed by the entity. * * @return Maximum number of servers managed by the entity. */ - int getMaxServers() const throw() { return a_maxServers; } + int getMaxServers() const { return a_maxServers; } /** @@ -134,27 +134,27 @@ public: * * @param description Entity description. Empty by default. */ - void setDescription(const std::string &description) throw() { a_description = description; } + void setDescription(const std::string &description) { a_description = description; } /** * Gets the entity description. * * @return Entity description. */ - const std::string & getDescription() const throw() { return a_description; } + const std::string & getDescription() const { return a_description; } /** * Sets the diameter::comm::Engine * @param e Diameter::comm::Engine */ - void setEngine(Engine *e) throw() { a_engine = e; } + void setEngine(Engine *e) { a_engine = e; } /** * Gets the diameter::comm::Engine * @return Diameter::comm::Engine */ - Engine *getEngine() const throw() { return a_engine; } + Engine *getEngine() const { return a_engine; } /** * Add a server to the entity and create all the servers configured at #setSocketsPerDiameterServer within that server. @@ -163,21 +163,21 @@ public: * * @return Returns success on send operation over any server within the entity */ - void addServer(const socket_t & serverId) throw(anna::RuntimeException); + void addServer(const socket_t & serverId) noexcept(false); /** * Binds entity servers. * * @return Returns true if all client-session were successfully bound */ - bool bind() throw(anna::RuntimeException); + bool bind() noexcept(false); /** * Propagate auto recovery configuration to servers within entity * * @param autoRecovery Auto recovery indicator. True by default. */ - void raiseAutoRecovery(bool autoRecovery = true) throw(anna::RuntimeException); + void raiseAutoRecovery(bool autoRecovery = true) noexcept(false); /** Sets timeout for wait responses for any class code request for all entity servers @@ -185,27 +185,27 @@ public: \param v Diameter request type. \param millisecond Milliseconds for timeout */ - void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw(); + void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) ; /** Sets entity category. Used by application in order to categorize or clasify. @param category Entity category */ - void setCategory(int category) throw() { a_category = category; } + void setCategory(int category) { a_category = category; } /** Gets entity category. Used by application in order to categorize or clasify. @return Entity category */ - int getCategory() const throw() { return a_category; } + int getCategory() const { return a_category; } /** Gets the last used resource (server) during sending. Broadcast doesn't updates this information. */ - Server *getLastUsedResource() const throw() { return (a_lastUsedResource); } + Server *getLastUsedResource() const { return (a_lastUsedResource); } /** @@ -214,14 +214,14 @@ public: * * @param balance True or false to enable or disable. */ - void setBalance (bool balance) throw() { a_balance = balance; } + void setBalance (bool balance) { a_balance = balance; } /** * Gets the balance mode * * @return True if balance over entity servers is enabled, false if standard behaviour is configured (default). */ - bool getBalance() const throw() { return a_balance; } + bool getBalance() const { return a_balance; } // SIMPLE BALANCE or STANDARD documentation version @@ -269,20 +269,20 @@ public: and error counter will be generated in this case). Broadcast try to send all over the resources in spite of any fail. */ - bool send(const Message *message) throw(anna::RuntimeException); - bool send(const Message &message) throw(anna::RuntimeException) { return send(&message); } + bool send(const Message *message) noexcept(false); + bool send(const Message &message) noexcept(false) { return send(&message); } /** * Sets sessions based models type. * \param sessionBasedModelsType Session based models type: RoundRobin, SessionIdLowPart (default), SessionIdHighPart or SessionIdOptionalPart. */ - void setSessionBasedModelsType(const SessionBasedModelsType::_v sessionBasedModelsType) throw() { a_sessionBasedModelsType = sessionBasedModelsType; } + void setSessionBasedModelsType(const SessionBasedModelsType::_v sessionBasedModelsType) { a_sessionBasedModelsType = sessionBasedModelsType; } /** * Returns sessions based models type. * \return Session based models type: RoundRobin, SessionIdLowPart, SessionIdHighPart or SessionIdOptionalPart. */ - SessionBasedModelsType::_v getSessionBasedModelsType() const throw() { return a_sessionBasedModelsType; } + SessionBasedModelsType::_v getSessionBasedModelsType() const { return a_sessionBasedModelsType; } /** @@ -340,7 +340,7 @@ public: @return Socket-id used within range [0,maxClientSessions-1]. Value '-1' if round-robin is desired. If socket-id is return out of range, send procedure will throw an exception. */ - virtual int readSocketId(const Message *message, int maxClientSessions) const throw(); + virtual int readSocketId(const Message *message, int maxClientSessions) const ; /** @@ -352,24 +352,24 @@ public: @return Returns true (success) only when broadcast is success over all the entity servers. If any server fails, then false is returned. */ - bool broadcast(const Message *message) throw(anna::RuntimeException); - bool broadcast(const Message &message) throw(anna::RuntimeException) { return broadcast(&message); } + bool broadcast(const Message *message) noexcept(false); + bool broadcast(const Message &message) noexcept(false) { return broadcast(&message); } /** Returns true when any of the entity servers is Bound. False when all not-bound. */ - bool isAvailable() const throw() { return a_available; } + bool isAvailable() const { return a_available; } /** Returns true when the entity has been selected as deprecated */ - bool isDeprecated() const throw() { return a_deprecated; } + bool isDeprecated() const { return a_deprecated; } /** Sets the entity deprecated state */ - void setDeprecated(bool deprecated = true) throw() { a_deprecated = deprecated; } + void setDeprecated(bool deprecated = true) { a_deprecated = deprecated; } /** @@ -377,81 +377,81 @@ public: @return OTA messages. */ - int getOTARequests() const throw(); + int getOTARequests() const ; /** Returns idle state (no pending answers). @return Idle state. */ - bool idle() const throw() { return (getOTARequests() == 0); } + bool idle() const { return (getOTARequests() == 0); } - std::vector::iterator begin() throw() { return a_servers.begin(); } - std::vector::iterator end() throw() { return a_servers.end(); } - std::vector::const_iterator begin() const throw() { return a_servers.begin(); } - std::vector::const_iterator end() const throw() { return a_servers.end(); } + std::vector::iterator begin() { return a_servers.begin(); } + std::vector::iterator end() { return a_servers.end(); } + std::vector::const_iterator begin() const { return a_servers.begin(); } + std::vector::const_iterator end() const { return a_servers.end(); } /** Close all the entity servers (close client-sessions within them). Depending on client-session configuration ('OnDisconnect' behaviour), pending answers will be wait (graceful) or ignored (immediate-abrupt close). Resources are not destroyed. */ - void close() throw(anna::RuntimeException) { close(false /* no destroy */); } + void close() noexcept(false) { close(false /* no destroy */); } // helpers /** Number of currently configured servers */ - int getNumberOfServers() const throw() { return a_servers.size(); } + int getNumberOfServers() const { return a_servers.size(); } /** Number of maximum allowed servers */ - int getMaxServerss() const throw() { return a_maxServers; } + int getMaxServerss() const { return a_maxServers; } /** List of (address,port) pairs defining entity servers */ - socket_v getAddressPortList() const throw(); + socket_v getAddressPortList() const ; /** Deny resources for delivery restriction. Deny all its servers */ - void hide() throw(); + void hide() ; /** Allow resource for delivery permission. Allow all its servers */ - void show() throw(); + void show() ; /** Returns true when all its servers resources are hidden for application messages delivery */ - bool hidden() const throw(); + bool hidden() const ; /** Returns true when all its servers resources are shown for application messages delivery */ - bool shown() const throw(); + bool shown() const ; /** Class string representation \return String with relevant information for this instance. */ - std::string asString() const throw(); + std::string asString() const ; /** Class xml representation \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; protected: @@ -461,7 +461,7 @@ protected: Default implementation traces warning event \param clientSession ClientSession from which shutdown has been received */ - virtual void eventPeerShutdown(const ClientSession* clientSession) throw(); + virtual void eventPeerShutdown(const ClientSession* clientSession) ; /** Handler about a request retransmission over the session. @@ -469,14 +469,14 @@ protected: \param clientSession ClientSession from which retransmission happened \param request Retransmitted request message */ - virtual void eventRequestRetransmission(const ClientSession* clientSession, Message *request) throw(); + virtual void eventRequestRetransmission(const ClientSession* clientSession, Message *request) ; /** Handler for diameter server (server) responses \param response Answer container object for corresponding diameter request */ - virtual void eventResponse(const Response& response) throw(anna::RuntimeException) = 0; + virtual void eventResponse(const Response& response) noexcept(false) = 0; /** Handler for diameter server (server) requests @@ -484,8 +484,8 @@ protected: \param clientSession ClientSession from which request has been received \param request Diameter request message received */ - virtual void eventRequest(ClientSession* clientSession, const anna::DataBlock &request) throw(anna::RuntimeException) = 0; - //virtual void eventRequest(ClientSession* clientSession, const Message& request) throw(anna::RuntimeException) = 0; + virtual void eventRequest(ClientSession* clientSession, const anna::DataBlock &request) noexcept(false) = 0; + //virtual void eventRequest(ClientSession* clientSession, const Message& request) noexcept(false) = 0; /** Handler for diameter session responses out of context @@ -493,7 +493,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false) = 0; /** Handler for diameter session Disconnect-Peer-Answer messages @@ -501,7 +501,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false) = 0;