mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-25 06:56:42 +08:00
35 lines
571 B
C++
35 lines
571 B
C++
/*
|
|
* predixy - A high performance and full features proxy for redis.
|
|
* Copyright (C) 2017 Joyield, Inc. <joyield.com@gmail.com>
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#ifndef _PREDIXY_DISTRIBUTION_H_
|
|
#define _PREDIXY_DISTRIBUTION_H_
|
|
|
|
class Distribution
|
|
{
|
|
public:
|
|
enum Type
|
|
{
|
|
None,
|
|
Modula,
|
|
Random
|
|
};
|
|
public:
|
|
Distribution(Type t = None):
|
|
mType(t)
|
|
{
|
|
}
|
|
operator Type() const
|
|
{
|
|
return mType;
|
|
}
|
|
const char* name() const;
|
|
static Distribution parse(const char* str);
|
|
private:
|
|
Type mType;
|
|
};
|
|
|
|
#endif
|