mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-21 05:45:23 -04:00
set events that has relationship in a batch
Signed-off-by: hwzhangchuang <zhangchuang.zhang@huawei.com>
This commit is contained in:
@@ -17,8 +17,11 @@
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <random>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -439,6 +442,14 @@ std::string GetString(const std::vector<std::string> &vec)
|
||||
retStr += "]";
|
||||
return retStr;
|
||||
}
|
||||
|
||||
int32_t GetRandomInt32()
|
||||
{
|
||||
std::default_random_engine engine(time(nullptr));
|
||||
|
||||
std::uniform_int_distribution<int> distribution(0, INT32_MAX);
|
||||
return distribution(engine);
|
||||
}
|
||||
} // namespace DistributedInput
|
||||
} // namespace DistributedHardware
|
||||
} // namespace OHOS
|
||||
Reference in New Issue
Block a user