Create RWBackends from servers

Added a helper function that creates a list of servers to use. This should
remove some of the duplicate code in the routers.
This commit is contained in:
Markus Mäkelä
2018-03-29 10:30:33 +03:00
parent 6ef9e1fd9a
commit d5643bc14d
3 changed files with 23 additions and 12 deletions

View File

@ -33,12 +33,19 @@ enum reply_state_t
typedef std::map<uint32_t, uint32_t> BackendHandleMap; /** Internal ID to external ID */
class RWBackend;
typedef std::tr1::shared_ptr<RWBackend> SRWBackend;
typedef std::list<SRWBackend> SRWBackendList;
class RWBackend: public mxs::Backend
{
RWBackend(const RWBackend&);
RWBackend& operator=(const RWBackend&);
public:
static SRWBackendList from_servers(SERVER_REF* servers);
RWBackend(SERVER_REF* ref);
~RWBackend();
@ -85,7 +92,4 @@ private:
uint8_t m_command;
};
typedef std::tr1::shared_ptr<RWBackend> SRWBackend;
typedef std::list<SRWBackend> SRWBackendList;
}