Ice 3.7 C++11 API Reference
Classes | Typedefs | Enumerations | Functions | Variables
IceUtil Namespace Reference

Classes

class  BadThreadControlException
 
class  BasicStringConverter
 A StringConverter converts narrow or wide-strings to and from UTF-8 byte sequences. More...
 
class  Cond
 
class  CtrlCHandler
 Provides a portable way to handle Ctrl-C and Ctrl-C like signals. More...
 
class  CtrlCHandlerException
 Raised by the CtrlCHandler constructor if another CtrlCHandler already exists. More...
 
class  Exception
 Abstract base class for all Ice exceptions. More...
 
class  ExceptionHelper
 Helper template for the implementation of Ice::Exception. More...
 
class  FileLockException
 This exception indicates the failure to lock a file. More...
 
class  Handle
 
class  HandleBase
 
class  IllegalArgumentException
 This exception indicates that a function was called with an illegal parameter value. More...
 
class  IllegalConversionException
 This exception indicates the failure of a string conversion. More...
 
class  InvalidTimeoutException
 
class  LockT
 
class  Monitor
 
class  Mutex
 
class  noncopyable
 
class  NullHandleException
 This exception indicates an attempt to dereference a null IceUtil::Handle or IceInternal::Handle. More...
 
class  OptionalNotSetException
 This exception indicates an IceUtil::Optional is not set. More...
 
class  RecMutex
 
class  Shared
 
class  SimpleShared
 
class  SyscallException
 This exception indicates the failure of a system call. More...
 
class  Thread
 
class  ThreadControl
 
class  ThreadLockedException
 
class  ThreadNotStartedException
 
class  ThreadStartedException
 
class  ThreadSyscallException
 
class  Time
 
class  Timer
 
class  TimerTask
 
class  TryLockT
 
class  UTF8Buffer
 Provides bytes to toUTF8. More...
 

Typedefs

typedef unsigned char Byte
 
using CtrlCHandlerCallback = std::function< void(int sig)>
 Invoked when a signal occurs. More...
 
typedef long long Int64
 
template<class T >
using Optional = std::experimental::Ice::optional< T >
 For compatibility with the Ice C++98 mapping, do not use in new code: More...
 
typedef BasicStringConverter< char > StringConverter
 A narrow string converter. More...
 
using StringConverterPtr = ::std::shared_ptr< StringConverter >
 
template<typename E >
using SyscallExceptionHelper = ExceptionHelper< E, SyscallException >
 
typedef Handle< ThreadThreadPtr
 
typedef IceUtil::Handle< TimerTimerPtr
 
using TimerTaskPtr = ::std::shared_ptr< TimerTask >
 
typedef BasicStringConverter< wchar_t > WstringConverter
 A wide string converter. More...
 
using WstringConverterPtr = ::std::shared_ptr< WstringConverter >
 

Enumerations

enum  MutexProtocol { PrioInherit, PrioNone }
 

Functions

WstringConverterPtr createUnicodeWstringConverter ()
 Creates a WstringConverter that converts to and from UTF-16 or UTF-32 depending on sizeof(wchar_t). More...
 
std::string generateUUID ()
 Generates a universally unique identifier (UUID). More...
 
MutexProtocol getDefaultMutexProtocol ()
 
StringConverterPtr getProcessStringConverter ()
 Retrieves the per-process narrow string converter. More...
 
WstringConverterPtr getProcessWstringConverter ()
 Retrieves the per-process wide string converter. More...
 
std::string nativeToUTF8 (const std::string &str, const StringConverterPtr &nc)
 Converts the given string from the native narrow string encoding to UTF-8 using the given converter. More...
 
template<typename T , typename U >
bool operator!= (const HandleBase< T > &lhs, const HandleBase< U > &rhs)
 
template<typename T , typename U >
bool operator< (const HandleBase< T > &lhs, const HandleBase< U > &rhs)
 
std::ostream & operator<< (std::ostream &, const Exception &)
 
std::ostream & operator<< (std::ostream &, const Time &)
 
template<typename T , typename U >
bool operator<= (const HandleBase< T > &lhs, const HandleBase< U > &rhs)
 
template<typename T , typename U >
bool operator== (const HandleBase< T > &lhs, const HandleBase< U > &rhs)
 
template<typename T , typename U >
bool operator> (const HandleBase< T > &lhs, const HandleBase< U > &rhs)
 
template<typename T , typename U >
bool operator>= (const HandleBase< T > &lhs, const HandleBase< U > &rhs)
 
void setProcessStringConverter (const StringConverterPtr &c)
 Sets the per-process narrow string converter. More...
 
void setProcessWstringConverter (const WstringConverterPtr &c)
 Sets the per process wide string converter. More...
 
std::wstring stringToWstring (const std::string &str, const StringConverterPtr &nc=0, const WstringConverterPtr &wc=0)
 Converts the given narrow string to a wide string. More...
 
std::string UTF8ToNative (const std::string &str, const StringConverterPtr &nc)
 Converts the given string from UTF-8 to the native narrow string encoding using the given converter. More...
 
std::string wstringToString (const std::wstring &str, const StringConverterPtr &nc=0, const WstringConverterPtr &wc=0)
 Converts the given wide string to a narrow string. More...
 

Variables

constexpr std::experimental::Ice::nullopt_t None {std::experimental::Ice::nullopt_t::init()}
 For compatibility with the Ice C++98 mapping, do not use in new code: More...
 

Typedef Documentation

◆ Byte

typedef unsigned char IceUtil::Byte

◆ CtrlCHandlerCallback

using IceUtil::CtrlCHandlerCallback = typedef std::function<void(int sig)>

Invoked when a signal occurs.

The callback must not raise exceptions. On Linux and macOS, the callback is NOT a signal handler and can call functions that are not async-signal safe.

Parameters
sigThe signal number that occurred.

◆ Int64

typedef long long IceUtil::Int64

◆ Optional

template<class T >
using IceUtil::Optional = typedef std::experimental::Ice::optional<T>

For compatibility with the Ice C++98 mapping, do not use in new code:

◆ StringConverter

A narrow string converter.

◆ StringConverterPtr

using IceUtil::StringConverterPtr = typedef ::std::shared_ptr< StringConverter >

◆ SyscallExceptionHelper

template<typename E >
using IceUtil::SyscallExceptionHelper = typedef ExceptionHelper<E, SyscallException>

◆ ThreadPtr

◆ TimerPtr

◆ TimerTaskPtr

using IceUtil::TimerTaskPtr = typedef ::std::shared_ptr< TimerTask >

◆ WstringConverter

A wide string converter.

◆ WstringConverterPtr

using IceUtil::WstringConverterPtr = typedef ::std::shared_ptr< WstringConverter >

Enumeration Type Documentation

◆ MutexProtocol

Enumerator
PrioInherit 
PrioNone 

Function Documentation

◆ createUnicodeWstringConverter()

WstringConverterPtr IceUtil::createUnicodeWstringConverter ( )

Creates a WstringConverter that converts to and from UTF-16 or UTF-32 depending on sizeof(wchar_t).

Returns
The string converter.

◆ generateUUID()

std::string IceUtil::generateUUID ( )

Generates a universally unique identifier (UUID).

Returns
The UUID.

◆ getDefaultMutexProtocol()

MutexProtocol IceUtil::getDefaultMutexProtocol ( )

◆ getProcessStringConverter()

StringConverterPtr IceUtil::getProcessStringConverter ( )

Retrieves the per-process narrow string converter.

Returns
The string converter.

◆ getProcessWstringConverter()

WstringConverterPtr IceUtil::getProcessWstringConverter ( )

Retrieves the per-process wide string converter.

Returns
The string converter.

◆ nativeToUTF8()

std::string IceUtil::nativeToUTF8 ( const std::string &  str,
const StringConverterPtr nc 
)

Converts the given string from the native narrow string encoding to UTF-8 using the given converter.

Parameters
strThe native narrow string.
ncThe narrow string converter. If null, the native string is returned.
Returns
A UTF-8 string.

◆ operator!=()

template<typename T , typename U >
bool IceUtil::operator!= ( const HandleBase< T > &  lhs,
const HandleBase< U > &  rhs 
)
inline

◆ operator<()

template<typename T , typename U >
bool IceUtil::operator< ( const HandleBase< T > &  lhs,
const HandleBase< U > &  rhs 
)
inline

◆ operator<<() [1/2]

std::ostream& IceUtil::operator<< ( std::ostream &  ,
const Exception  
)

◆ operator<<() [2/2]

std::ostream& IceUtil::operator<< ( std::ostream &  ,
const Time  
)

◆ operator<=()

template<typename T , typename U >
bool IceUtil::operator<= ( const HandleBase< T > &  lhs,
const HandleBase< U > &  rhs 
)
inline

◆ operator==()

template<typename T , typename U >
bool IceUtil::operator== ( const HandleBase< T > &  lhs,
const HandleBase< U > &  rhs 
)
inline

◆ operator>()

template<typename T , typename U >
bool IceUtil::operator> ( const HandleBase< T > &  lhs,
const HandleBase< U > &  rhs 
)
inline

◆ operator>=()

template<typename T , typename U >
bool IceUtil::operator>= ( const HandleBase< T > &  lhs,
const HandleBase< U > &  rhs 
)
inline

◆ setProcessStringConverter()

void IceUtil::setProcessStringConverter ( const StringConverterPtr c)

Sets the per-process narrow string converter.

Parameters
cThe string converter.

◆ setProcessWstringConverter()

void IceUtil::setProcessWstringConverter ( const WstringConverterPtr c)

Sets the per process wide string converter.

Parameters
cThe string converter.

◆ stringToWstring()

std::wstring IceUtil::stringToWstring ( const std::string &  str,
const StringConverterPtr nc = 0,
const WstringConverterPtr wc = 0 
)

Converts the given narrow string to a wide string.

Parameters
strA narrow string.
ncThe narrow string converter. If null, the result's narrow string encoding is UTF-8.
wcThe wide string converter. If null, the input's wstring encoding is UTF-16 or UTF-32 depending on the size of wchar_t.
Returns
A wide string.

◆ UTF8ToNative()

std::string IceUtil::UTF8ToNative ( const std::string &  str,
const StringConverterPtr nc 
)

Converts the given string from UTF-8 to the native narrow string encoding using the given converter.

Parameters
strThe UTF-8 string.
ncThe narrow string converter. If null, the UTF-8 string is returned.
Returns
A native narrow string.

◆ wstringToString()

std::string IceUtil::wstringToString ( const std::wstring &  str,
const StringConverterPtr nc = 0,
const WstringConverterPtr wc = 0 
)

Converts the given wide string to a narrow string.

Parameters
strA wide string.
ncThe narrow string converter. If null, the result's narrow string encoding is UTF-8.
wcThe wide string converter. If null, the input's wstring encoding is UTF-16 or UTF-32 depending on the size of wchar_t.
Returns
A narrow string.

Variable Documentation

◆ None

constexpr std::experimental::Ice::nullopt_t IceUtil::None {std::experimental::Ice::nullopt_t::init()}
constexpr

For compatibility with the Ice C++98 mapping, do not use in new code: