Adbase
Adinf C++ base library V2
adbase::detail Namespace Reference

Classes

struct  Comp
 
class  File
 
class  FixedBuffer
 
struct  Localtime
 
struct  Transition
 

Functions

template<typename T >
size_t convert (char buf[], T value)
 
size_t convertHex (char buf[], uintptr_t value)
 
void acceptHandler (int fd, short evt, void *arg)
 
void handlerConnector (int sockfd, short evt, void *arg)
 
void eventCallback (struct bufferevent *, short events, void *ptr)
 
void readCallback (struct bufferevent *, void *ptr)
 
void writeCallback (struct bufferevent *, void *ptr)
 
void defaultConnectionCallback (const TcpConnectionPtr &conn)
 
void defaultMessageCallback (const TcpConnectionPtr &conn, evbuffer *buffer, Timestamp receiveTime)
 
void pipeHandler (int, short evt, void *arg)
 
void timerHandler (int, short, void *arg)
 
int getJulianDayNumber (int year, int month, int day)
 algorithm and explanation see: http://www.faqs.org/faqs/calendars/faq/part2/ More...
 
struct Date::YearMonthDay getYearMonthDay (int julianDayNumber)
 
static void reset (uint32_t digest[], std::string &buffer, uint64_t &transforms)
 
static uint32_t rol (const uint32_t value, const size_t bits)
 
static uint32_t blk (const uint32_t block[BLOCK_INTS], const size_t i)
 
static void R0 (const uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
 
static void R1 (uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
 
static void R2 (uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
 
static void R3 (uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
 
static void R4 (uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t &w, const uint32_t x, const uint32_t y, uint32_t &z, const size_t i)
 
static void transform (uint32_t digest[], uint32_t block[BLOCK_INTS], uint64_t &transforms)
 
static void buffer_to_block (const std::string &buffer, uint32_t block[BLOCK_INTS])
 
void fillHMS (unsigned seconds, struct tm *utc)
 
bool readTimeZoneFile (const char *zonefile, struct TimeZone::Data *data)
 
const LocaltimefindLocaltime (const TimeZone::Data &data, Transition sentry, Comp comp)
 

Variables

const char digits [] = "9876543210123456789"
 
const char digitsHex [] = "0123456789ABCDEF"
 
const char * zero = digits + 9
 
const int kSmallBuffer = 4000
 
const int kLargeBuffer = 4000 * 4000
 
static const size_t BLOCK_INTS = 16
 
static const size_t BLOCK_BYTES = BLOCK_INTS * 4
 

Function Documentation

void adbase::detail::acceptHandler ( int  fd,
short  evt,
void *  arg 
)
static uint32_t adbase::detail::blk ( const uint32_t  block[BLOCK_INTS],
const size_t  i 
)
static

Definition at line 38 of file Sha1.cpp.

References rol().

Referenced by R1(), R2(), R3(), and R4().

static void adbase::detail::buffer_to_block ( const std::string &  buffer,
uint32_t  block[BLOCK_INTS] 
)
static

Definition at line 199 of file Sha1.cpp.

References BLOCK_INTS.

Referenced by adbase::Sha1::final(), and adbase::Sha1::update().

template<typename T >
size_t adbase::detail::convert ( char  buf[],
T  value 
)

Definition at line 20 of file LogStream.cpp.

Referenced by adbase::detail::FixedBuffer< SIZE >::debugString().

size_t adbase::detail::convertHex ( char  buf[],
uintptr_t  value 
)

Definition at line 41 of file LogStream.cpp.

Referenced by adbase::LogStream::operator<<().

void adbase::detail::defaultConnectionCallback ( const TcpConnectionPtr conn)

Definition at line 32 of file TcpConnection.cpp.

References LOG_TRACE.

void adbase::detail::defaultMessageCallback ( const TcpConnectionPtr conn,
evbuffer *  buffer,
Timestamp  receiveTime 
)

Definition at line 40 of file TcpConnection.cpp.

void adbase::detail::eventCallback ( struct bufferevent *  ,
short  events,
void *  ptr 
)
void adbase::detail::fillHMS ( unsigned  seconds,
struct tm *  utc 
)
inline

Definition at line 63 of file TimeZone.cpp.

Referenced by adbase::TimeZone::toUtcTime().

const Localtime* adbase::detail::findLocaltime ( const TimeZone::Data data,
Transition  sentry,
Comp  comp 
)
int adbase::detail::getJulianDayNumber ( int  year,
int  month,
int  day 
)

algorithm and explanation see: http://www.faqs.org/faqs/calendars/faq/part2/

Definition at line 12 of file Date.cpp.

Referenced by getYearMonthDay().

void adbase::detail::handlerConnector ( int  sockfd,
short  evt,
void *  arg 
)
void adbase::detail::pipeHandler ( int  ,
short  evt,
void *  arg 
)
static void adbase::detail::R0 ( const uint32_t  block[BLOCK_INTS],
const uint32_t  v,
uint32_t &  w,
const uint32_t  x,
const uint32_t  y,
uint32_t &  z,
const size_t  i 
)
static

Definition at line 48 of file Sha1.cpp.

References rol().

Referenced by transform().

static void adbase::detail::R1 ( uint32_t  block[BLOCK_INTS],
const uint32_t  v,
uint32_t &  w,
const uint32_t  x,
const uint32_t  y,
uint32_t &  z,
const size_t  i 
)
static

Definition at line 56 of file Sha1.cpp.

References blk(), and rol().

Referenced by transform().

static void adbase::detail::R2 ( uint32_t  block[BLOCK_INTS],
const uint32_t  v,
uint32_t &  w,
const uint32_t  x,
const uint32_t  y,
uint32_t &  z,
const size_t  i 
)
static

Definition at line 65 of file Sha1.cpp.

References blk(), and rol().

Referenced by transform().

static void adbase::detail::R3 ( uint32_t  block[BLOCK_INTS],
const uint32_t  v,
uint32_t &  w,
const uint32_t  x,
const uint32_t  y,
uint32_t &  z,
const size_t  i 
)
static

Definition at line 74 of file Sha1.cpp.

References blk(), and rol().

Referenced by transform().

static void adbase::detail::R4 ( uint32_t  block[BLOCK_INTS],
const uint32_t  v,
uint32_t &  w,
const uint32_t  x,
const uint32_t  y,
uint32_t &  z,
const size_t  i 
)
static

Definition at line 83 of file Sha1.cpp.

References blk(), and rol().

Referenced by transform().

void adbase::detail::readCallback ( struct bufferevent *  ,
void *  ptr 
)
static void adbase::detail::reset ( uint32_t  digest[],
std::string &  buffer,
uint64_t &  transforms 
)
static

Definition at line 15 of file Sha1.cpp.

Referenced by adbase::Sha1::final(), and adbase::Sha1::Sha1().

static uint32_t adbase::detail::rol ( const uint32_t  value,
const size_t  bits 
)
static

Definition at line 31 of file Sha1.cpp.

Referenced by blk(), R0(), R1(), R2(), R3(), and R4().

void adbase::detail::timerHandler ( int  ,
short  ,
void *  arg 
)

Definition at line 9 of file Timer.cpp.

References adbase::TimerItem::timerHandler().

Referenced by adbase::TimerItem::TimerItem().

static void adbase::detail::transform ( uint32_t  digest[],
uint32_t  block[BLOCK_INTS],
uint64_t &  transforms 
)
static

Definition at line 95 of file Sha1.cpp.

References R0(), R1(), R2(), R3(), and R4().

Referenced by adbase::Sha1::final(), and adbase::Sha1::update().

void adbase::detail::writeCallback ( struct bufferevent *  ,
void *  ptr 
)

Variable Documentation

const size_t adbase::detail::BLOCK_BYTES = BLOCK_INTS * 4
static

Definition at line 12 of file Sha1.cpp.

Referenced by adbase::Sha1::final(), and adbase::Sha1::update().

const size_t adbase::detail::BLOCK_INTS = 16
static

Definition at line 11 of file Sha1.cpp.

Referenced by buffer_to_block(), adbase::Sha1::final(), and adbase::Sha1::update().

const char adbase::detail::digits[] = "9876543210123456789"

Definition at line 13 of file LogStream.cpp.

const char adbase::detail::digitsHex[] = "0123456789ABCDEF"

Definition at line 15 of file LogStream.cpp.

const int adbase::detail::kLargeBuffer = 4000 * 4000

Definition at line 22 of file LogStream.hpp.

const int adbase::detail::kSmallBuffer = 4000

Definition at line 21 of file LogStream.hpp.

const char* adbase::detail::zero = digits + 9

Definition at line 17 of file LogStream.cpp.