mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-02 05:22:26 +03:00
Provider type abstraction, partially completed.
This commit is contained in:
28
include/wsrep/client_id.hpp
Normal file
28
include/wsrep/client_id.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright (C) 2018 Codership Oy <info@codership.com>
|
||||
//
|
||||
|
||||
#ifndef WSREP_CLIENT_ID_HPP
|
||||
#define WSREP_CLIENT_ID_HPP
|
||||
|
||||
namespace wsrep
|
||||
{
|
||||
class client_id
|
||||
{
|
||||
public:
|
||||
typedef unsigned long long type;
|
||||
client_id()
|
||||
: id_(-1)
|
||||
{ }
|
||||
template <typename I>
|
||||
client_id(I id)
|
||||
: id_(static_cast<type>(id))
|
||||
{ }
|
||||
type get() const { return id_; }
|
||||
static type invalid() { return -1; }
|
||||
private:
|
||||
type id_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // WSREP_CLIENT_ID_HPP
|
Reference in New Issue
Block a user