Derecho  0.9
Distributed systems toolkit for RDMA
Macros | Functions
util.hpp File Reference
#include "../PersistException.hpp"
#include <derecho/conf/conf.hpp>
#include <errno.h>
#include <fcntl.h>
#include <string>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
Include dependency graph for util.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX(a, b)
 
#define MIN(a, b)
 
#define HIGH__int128(x)   (*((uint64_t*)((uint64_t)(&(x)) + 8)))
 
#define LOW__int128(x)   (*((uint64_t*)&(x)))
 

Functions

std::string getPersRamdiskPath ()
 
std::string getPersFilePath ()
 
void checkOrCreateDir (const std::string &dirPath) noexcept(false)
 
bool checkRegularFile (const std::string &file) noexcept(false)
 
bool checkOrCreateFileWithSize (const std::string &file, uint64_t size) noexcept(false)
 

Macro Definition Documentation

◆ HIGH__int128

#define HIGH__int128 (   x)    (*((uint64_t*)((uint64_t)(&(x)) + 8)))

Definition at line 23 of file util.hpp.

◆ LOW__int128

#define LOW__int128 (   x)    (*((uint64_t*)&(x)))

Definition at line 24 of file util.hpp.

◆ MAX

#define MAX (   a,
 
)
Value:
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })

Definition at line 13 of file util.hpp.

◆ MIN

#define MIN (   a,
 
)
Value:
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })

Definition at line 18 of file util.hpp.

Function Documentation

◆ checkOrCreateDir()

void checkOrCreateDir ( const std::string &  dirPath)
inlinenoexcept

Definition at line 43 of file util.hpp.

◆ checkOrCreateFileWithSize()

bool checkOrCreateFileWithSize ( const std::string &  file,
uint64_t  size 
)
inlinenoexcept

Definition at line 75 of file util.hpp.

◆ checkRegularFile()

bool checkRegularFile ( const std::string &  file)
inlinenoexcept

Definition at line 58 of file util.hpp.

◆ getPersFilePath()

std::string getPersFilePath ( )
inline

Definition at line 36 of file util.hpp.

◆ getPersRamdiskPath()

std::string getPersRamdiskPath ( )
inline

Definition at line 29 of file util.hpp.