osl::misc Namespace Reference

## Namespaces

namespace | detail

## Classes

struct | Int2Type
struct | Type2Type
struct | Player2Type
struct | EmptyType
struct | Align16New
struct | BinaryWriter
class | BinaryReader
class | BinaryElementReader
struct | Bsf
| x86 bsf 命令 More...
struct | Bsf< unsigned int >
struct | Bsf< unsigned short >
struct | Bsf< unsigned long long >
struct | Bsr
struct | Bsr< unsigned int >
struct | Bsr< unsigned long long >
struct | BitOp
class | GeneralMask
struct | Random
struct | Random< unsigned int >
struct | Random< unsigned long long >
struct | IncrementLock
class | AtomicCounter
struct | IconvConvert
class | LightScopedLock
class | LightMutex
class | LightMutexChar
struct | NoMoreTime

## Typedefs

typedef GeneralMask< unsigned long long > | Mask64
typedef unsigned long long | mask_int_t
typedef GeneralMask< mask_int_t > | mask_t
typedef std::chrono::high_resolution_clock | clock
typedef std::chrono::time_point< clock > | time_point
typedef std::chrono::milliseconds | milliseconds

## Functions

template<typename T1, typename T2>
void | construct (T1 *ptr, const T2 &value, typename boost::enable_if< detail::BitCopyTraits< T1 > >::type *=0)
template<typename T1, typename T2>
void | construct (T1 *ptr, const T2 &value, typename boost::disable_if< detail::BitCopyTraits< T1 > >::type *=0)
template<typename T>
void | destroy (T *ptr)
template<typename ForwardIterator>
void | destroy (ForwardIterator first, ForwardIterator last)
template<class Integer>
bool | operator== (const GeneralMask< Integer > &l, const GeneralMask< Integer > &r)
template<class Integer>
bool | operator!= (const GeneralMask< Integer > &l, const GeneralMask< Integer > &r)
template<class Integer>
bool | operator< (const GeneralMask< Integer > &l, const GeneralMask< Integer > &r)
template<class Integer>
const GeneralMask< Integer > | operator& (GeneralMask< Integer > l, GeneralMask< Integer > r)
template<class Integer>
const GeneralMask< Integer > | operator| (GeneralMask< Integer > l, GeneralMask< Integer > r)
template<class Integer>
const GeneralMask< Integer > | operator^ (GeneralMask< Integer > l, GeneralMask< Integer > r)
template<class Integer>
const GeneralMask< Integer > | operator<< (GeneralMask< Integer > m, int shift)
template<class Integer>
const GeneralMask< Integer > | operator>> (GeneralMask< Integer > m, int shift)
std::ostream & | operator<< (std::ostream &, const mask_t &)
unsigned int | random ()
unsigned int | time_seeded_random ()
std::string | base64Encode (boost::dynamic_bitset<> src)
boost::dynamic_bitset | base64Decode (std::string src)
std::string | toBase64 (const book::CompactBoard &)
book::CompactBoard | toCompactBoard (const std::string &str)
std::string | eucToLang (const std::string &src)
std::string | file_string (const boost::filesystem::path &path)
template<class Duration>
double | toSeconds (Duration duration)
template<class Duration>
long long | msec (Duration duration)
double | elapsedSeconds (time_point start)
std::string | sjis2euc (const std::string &str)
| Convert character encoding from Shift_JIS to EUC-JP.
void | sjis2euc (unsigned char &c1, unsigned char &c2)
| Reference: http://www.net.is.uec.ac.jp/~ueno/material/kanji/sjis2euc.html.

## Typedef Documentation

## clock

typedef std::chrono::high_resolution_clock osl::misc::clock

Definition at line 17 of file milliSeconds.h.

## Mask64

typedef GeneralMask<unsigned long long> osl::misc::Mask64

Definition at line 347 of file mask.h.

## mask_int_t

typedef unsigned long long osl::misc::mask_int_t

Definition at line 350 of file mask.h.

## mask_t

typedef GeneralMask<mask_int_t> osl::misc::mask_t

Definition at line 351 of file mask.h.

## milliseconds

typedef std::chrono::milliseconds osl::misc::milliseconds

Definition at line 19 of file milliSeconds.h.

## time_point

typedef std::chrono::time_point<clock> osl::misc::time_point

Definition at line 18 of file milliSeconds.h.

## Function Documentation

## base64Decode()

boost::dynamic_bitset osl::misc::base64Decode | ( | std::string | src | ) |

Definition at line 55 of file base64.cc.

Referenced by osl::book::MiniBoard::fromBase64, and toCompactBoard().

## base64Encode()

std::string osl::misc::base64Encode | ( | boost::dynamic_bitset<> | src | ) |

Definition at line 4 of file base64.cc.

Referenced by osl::book::MiniBoard::toBase64(), and toBase64().

## construct() [1/2]

template<typename T1, typename T2>

void osl::misc::construct | ( | T1 * | ptr,
|  | const T2 & | value,
|  | typename boost::disable_if< detail::BitCopyTraits< T1 > >::type * | = 0 )

inline

Definition at line 49 of file construct.h.

## construct() [2/2]

template<typename T1, typename T2>

void osl::misc::construct | ( | T1 * | ptr,
|  | const T2 & | value,
|  | typename boost::enable_if< detail::BitCopyTraits< T1 > >::type * | = 0 )

inline

Definition at line 40 of file construct.h.

Referenced by osl::detail::FixedCapacityVectorPushBack< T >::push_back(), and osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::push_back().

## destroy() [1/2]

template<typename ForwardIterator>

void osl::misc::destroy | ( | ForwardIterator | first,
|  | ForwardIterator | last )

inline

Definition at line 63 of file construct.h.

References destroy().

## destroy() [2/2]

template<typename T>

void osl::misc::destroy | ( | T * | ptr | ) |

inline

Definition at line 57 of file construct.h.

Referenced by osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::clear(), destroy(), osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::erase(), osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::operator=(), osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::pop_back(), osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::resize(), osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::unique(), and osl::FixedCapacityVector< MoveLogProb, Move::MaxUniqMoves >::~FixedCapacityVector().

## elapsedSeconds()

double osl::misc::elapsedSeconds | ( | time_point | start | ) |

inline

Definition at line 29 of file milliSeconds.h.

References toSeconds().

## eucToLang()

std::string osl::misc::eucToLang | ( | const std::string & | src | ) |

Definition at line 13 of file eucToLang.cc.

References osl::misc::IconvConvert::eucToLang().

Referenced by osl::kakinoki::KakinokiFile::parseLine(), osl::record::KanjiPrint::print(), osl::record::KanjiMove::selectCandidates(), and osl::record::Record::setDate().

## file_string()

std::string osl::misc::file_string | ( | const boost::filesystem::path & | path | ) |

Definition at line 5 of file filePath.cc.

Referenced by osl::record::KisenFile::ipxFileName().

## msec()

template<class Duration>

long long osl::misc::msec | ( | Duration | duration | ) |

inline

Definition at line 26 of file milliSeconds.h.

## operator!=()

template<class Integer>

bool osl::misc::operator!= | ( | const GeneralMask< Integer > & | l,
|  | const GeneralMask< Integer > & | r )

inline

Definition at line 308 of file mask.h.

## operator&()

template<class Integer>

const GeneralMask< Integer > osl::misc::operator& | ( | GeneralMask< Integer > | l,
|  | GeneralMask< Integer > | r )

inline

Definition at line 319 of file mask.h.

## operator<()

template<class Integer>

bool osl::misc::operator< | ( | const GeneralMask< Integer > & | l,
|  | const GeneralMask< Integer > & | r )

inline

Definition at line 313 of file mask.h.

References osl::misc::GeneralMask< Integer >::value().

## operator<<() [1/2]

template<class Integer>

const GeneralMask< Integer > osl::misc::operator<< | ( | GeneralMask< Integer > | m,
|  | int | shift )

inline

Definition at line 337 of file mask.h.

## operator<<() [2/2]

std::ostream & osl::misc::operator<< | ( | std::ostream & | os,
|  | const mask_t & | mask )

Definition at line 10 of file mask.cc.

References osl::misc::GeneralMask< Integer >::value().

## operator==()

template<class Integer>

bool osl::misc::operator== | ( | const GeneralMask< Integer > & | l,
|  | const GeneralMask< Integer > & | r )

inline

Definition at line 303 of file mask.h.

References osl::misc::GeneralMask< Integer >::value().

## operator>>()

template<class Integer>

const GeneralMask< Integer > osl::misc::operator>> | ( | GeneralMask< Integer > | m,
|  | int | shift )

inline

Definition at line 342 of file mask.h.

## operator^()

template<class Integer>

const GeneralMask< Integer > osl::misc::operator^ | ( | GeneralMask< Integer > | l,
|  | GeneralMask< Integer > | r )

inline

Definition at line 331 of file mask.h.

## operator|()

template<class Integer>

const GeneralMask< Integer > osl::misc::operator| | ( | GeneralMask< Integer > | l,
|  | GeneralMask< Integer > | r )

inline

Definition at line 325 of file mask.h.

## random()

unsigned int osl::misc::random | ( |  | ) |

Definition at line 4 of file random.cc.

Referenced by osl::misc::Random< unsigned int >::newValue(), and osl::misc::Random< unsigned long long >::newValue().

## sjis2euc() [1/2]

std::string osl::misc::sjis2euc | ( | const std::string & | str | ) |

Convert character encoding from Shift_JIS to EUC-JP.

This converter is simple enough to be applied to Shogi records. It may not completely implement the conversion algorithm.

Definition at line 9 of file sjis2euc.cc.

References sjis2euc().

Referenced by osl::kakinoki::KakinokiFile::isKakinokiFile(), osl::kakinoki::KakinokiFile::KakinokiFile(), osl::ki2::Ki2File::Ki2File(), osl::record::KisenIpxFile::player(), sjis2euc(), and osl::record::KisenIpxFile::title().

## sjis2euc() [2/2]

void osl::misc::sjis2euc | ( | unsigned char & | c1,
|  | unsigned char & | c2 )

Reference: http://www.net.is.uec.ac.jp/~ueno/material/kanji/sjis2euc.html.

Definition at line 43 of file sjis2euc.cc.

## time_seeded_random()

unsigned int osl::misc::time_seeded_random | ( |  | ) |

Definition at line 10 of file random.cc.

## toBase64()

std::string osl::misc::toBase64 | ( | const book::CompactBoard & | board | ) |

Definition at line 106 of file base64.cc.

References base64Encode(), and osl::book::readInt().

## toCompactBoard()

osl::book::CompactBoard osl::misc::toCompactBoard | ( | const std::string & | str | ) |

Definition at line 131 of file base64.cc.

References base64Decode(), and osl::book::writeInt().

## toSeconds()

template<class Duration>

double osl::misc::toSeconds | ( | Duration | duration | ) |

inline

Definition at line 22 of file milliSeconds.h.

Referenced by elapsedSeconds().