libqi-api  2.1.4.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
qi Namespace Reference

qi general namespace More...

Namespaces

 detail
 
 details
 
 log
 Log functions with different levels of verbosity.
 
 os
 OS abstraction layer.
 
 path
 Set of tools to handle SDK layouts.
 
 version
 Version numbering API.
 

Classes

class  Application
 Class handling startup and teardown of an application. More...
 
struct  AtomicBase
 
class  Atomic
 Atomic operations on integers. More...
 
class  Buffer
 Class to store buffer. More...
 
class  BufferReader
 Class to read const buffer. More...
 
class  SteadyClock
 
class  WallClock
 
struct  FutureValueConverter< void, void >
 
struct  FutureValueConverter< T, void >
 
struct  FutureValueConverter< void, T >
 
class  Future
 
class  EventLoop
 
struct  FutureType
 
struct  FutureHasNoValue
 
struct  FutureType< void >
 
class  FutureInterface
 
class  FutureSync
 
class  Promise
 
class  FutureException
 
class  FutureUserException
 
class  FutureBarrier
 This class helps waiting on multiple futures at the same point. More...
 
struct  FutureValueConverter
 Specialize this struct to provide conversion between future values. More...
 
class  Path
 
class  PeriodicTask
 
class  SharedPtr
 Lightweight implementation of shared pointers. More...
 
class  MinMaxSum
 Stores min, max and sum of values fed to it. More...
 
class  MethodStatistics
 Store statistics about method calls. More...
 
class  ThreadPool
 Pool of workers. More...
 
class  TrackableBase
 Common base class to templates Trackable for compile-time detection. More...
 
class  Trackable
 
class  PointerLockException
 
struct  IsClonable
 Detect if a type is using boost::noncopyable or QI_DISALLOW_COPY_AND_ASSIGN. More...
 
class  Translator
 

Typedefs

typedef
boost::chrono::duration
< int64_t, boost::nano > 
Duration
 
typedef
boost::chrono::duration
< int64_t, boost::nano > 
NanoSeconds
 
typedef
boost::chrono::duration
< int64_t, boost::micro > 
MicroSeconds
 
typedef
boost::chrono::duration
< int64_t, boost::milli > 
MilliSeconds
 
typedef
boost::chrono::duration
< int64_t
Seconds
 
typedef
boost::chrono::duration
< int64_t, boost::ratio< 60 > > 
Minutes
 
typedef
boost::chrono::duration
< int64_t, boost::ratio< 3600 > > 
Hours
 
typedef
SteadyClock::SteadyClockTimePoint 
SteadyClockTimePoint
 
typedef
WallClock::WallClockTimePoint 
WallClockTimePoint
 
typedef int LogContext
 
typedef std::vector< PathPathVector
 
typedef std::codecvt< wchar_t,
char, std::mbstate_t > 
codecvt_type
 Standard std::codecvt type accepted by STL and boost. More...
 
typedef int8_t int8_t
 Cross-platform signed integer of length 8 bits (1 byte). More...
 
typedef int16_t int16_t
 Cross-platform signed integer of length 16 bits (2 bytes). More...
 
typedef int32_t int32_t
 Cross-platform signed integer of length 32 bits (4 bytes). More...
 
typedef int64_t int64_t
 Cross-platform signed integer of length 64 bits (8 bytes). More...
 
typedef uint8_t uint8_t
 Cross-platform unsigned integer of length 8 bits (1 byte). More...
 
typedef uint16_t uint16_t
 Cross-platform unsigned integer of length 16 bits (2 bytes). More...
 
typedef uint32_t uint32_t
 Cross-platform unsigned integer of length 32 bits (4 bytes). More...
 
typedef uint64_t uint64_t
 Cross-platform unsigned integer of length 64 bits (8 bytes). More...
 

Enumerations

enum  FutureState {
  FutureState_None, FutureState_Running, FutureState_Canceled, FutureState_FinishedWithError,
  FutureState_FinishedWithValue
}
 
enum  FutureCallbackType { FutureCallbackType_Sync = 0, FutureCallbackType_Async = 1 }
 
enum  FutureTimeout { FutureTimeout_Infinite = ((int) 0x7fffffff), FutureTimeout_None = 0 }
 
enum  StreamColor {
  StreamColor_None = 0, StreamColor_Reset = 1, StreamColor_Bold = 2, StreamColor_Faint = 3,
  StreamColor_Standout = 4, StreamColor_Underline = 5, StreamColor_Blink = 6, StreamColor_Overline = 7,
  StreamColor_Black = 8, StreamColor_DarkRed = 9, StreamColor_DarkGreen = 10, StreamColor_Brown = 11,
  StreamColor_DarkBlue = 12, StreamColor_Purple = 13, StreamColor_Teal = 14, StreamColor_LightGray = 15,
  StreamColor_DarkGray = 16, StreamColor_Red = 17, StreamColor_Green = 18, StreamColor_Yellow = 19,
  StreamColor_Blue = 20, StreamColor_Fuchsia = 21, StreamColor_Turquoise = 22, StreamColor_White = 23
}
 
enum  LogLevel {
  LogLevel_Silent = 0, LogLevel_Fatal, LogLevel_Error, LogLevel_Warning,
  LogLevel_Info, LogLevel_Verbose, LogLevel_Debug
}
 Log level verbosity. More...
 
enum  LogColor { LogColor_Never, LogColor_Auto, LogColor_Always }
 
enum  LogContextAttr {
  LogContextAttr_None = 0, LogContextAttr_Verbosity = 1 << 0, LogContextAttr_ShortVerbosity = 1 << 1, LogContextAttr_Date = 1 << 2,
  LogContextAttr_Tid = 1 << 3, LogContextAttr_Category = 1 << 4, LogContextAttr_File = 1 << 5, LogContextAttr_Function = 1 << 6,
  LogContextAttr_Return = 1 << 7
}
 

Functions

long testAndSet (long *cond)
 
SteadyClockTimePoint steadyClockNow ()
 
WallClockTimePoint wallClockNow ()
 
void sleepFor (const qi::Duration &d)
 
template<class Rep , class Period >
void sleepFor (const boost::chrono::duration< Rep, Period > &d)
 
void sleepUntil (const SteadyClockTimePoint &t)
 
template<class Duration >
void sleepUntil (const boost::chrono::time_point< SteadyClock, Duration > &t)
 
void sleepUntil (const WallClockTimePoint &t)
 
template<class Duration >
void sleepUntil (const boost::chrono::time_point< WallClock, Duration > &t)
 
template<typename R >
void nullConverter (void *, R &)
 
template<typename T >
qi::Future< T > makeFutureError (const std::string &error, FutureCallbackType async)
 
template<typename T >
void waitForAll (std::vector< Future< T > > &vect)
 Helper function to wait on a vector of futures. More...
 
template<typename T >
qi::FutureSync< qi::Future< T > > waitForFirst (std::vector< Future< T > > &vect)
 Helper function to wait for the first valid future. More...
 
template<typename FT , typename PT >
void adaptFuture (const Future< FT > &f, Promise< PT > &p)
 
template<typename FT , typename PT , typename CONV >
void adaptFuture (const Future< FT > &f, Promise< PT > &p, CONV converter)
 Similar to adaptFuture(f, p) but with a custom converter. More...
 
template<typename F , typename ARG0 >
boost::function< F > track (const boost::function< F > &f, const ARG0 &arg0)
 
template<typename F , typename ARG0 >
boost::function< F > trackWithFallback (boost::function< void()> onFail, const boost::function< F > &f, const ARG0 &arg0)
 
EventLoopgetEventLoop ()
 Return the global eventloop, created on demand on first call. More...
 
void startEventLoop (int nthread)
 Start the eventloop with nthread threads. No-op if already started. More...
 
boost::asio::io_service & getIoService ()
 Return the io_service used by the global event loop. More...
 
QI_API_DEPRECATED EventLoopgetDefaultNetworkEventLoop ()
 
QI_API_DEPRECATED EventLoopgetDefaultObjectEventLoop ()
 Return a default context for other uses. More...
 
QI_API_DEPRECATED EventLoopgetDefaultThreadPoolEventLoop ()
 Return a default thread pool context. More...
 
QI_API_DEPRECATED void init (int &argc, char **&argv)
 
QI_API_DEPRECATED int argc ()
 Deprecated, see detailed description. More...
 
QI_API_DEPRECATED const char ** argv ()
 Deprecated, see detailed description. More...
 
QI_API_DEPRECATED const char * program ()
 Deprecated, see detailed description. More...
 
const codecvt_typeunicodeFacet ()
 UTF-8 facet object getter. More...
 
template<typename RF , typename AF >
boost::function< RF > bind (const AF &fun,...)
 
template<typename T >
bool isClonable ()
 
template<typename T >
bool isClonable (T *)
 
qi::TranslatordefaultTranslator (const std::string &name)
 Get a reference on the default Translator. More...
 
std::string tr (const std::string &msg, const std::string &domain="", const std::string &locale="")
 Translate a message. More...
 

Detailed Description

qi general namespace

Localization of your source code - make your application or library speak in the user's language.

Typedef Documentation

Standard std::codecvt type accepted by STL and boost.

Typedef for std::codecvt<wchar_t, char, std::mbstate_t> that can be used with boost::filesystem::path and std::locale.

Definition at line 21 of file qi.hpp.

typedef boost::chrono::duration<int64_t, boost::nano> qi::Duration

Definition at line 19 of file clock.hpp.

typedef boost::chrono::duration<int64_t, boost::ratio<3600> > qi::Hours

Definition at line 25 of file clock.hpp.

Cross-platform signed integer of length 16 bits (2 bytes).

Definition at line 31 of file types.hpp.

Cross-platform signed integer of length 32 bits (4 bytes).

Definition at line 32 of file types.hpp.

Cross-platform signed integer of length 64 bits (8 bytes).

Definition at line 33 of file types.hpp.

Cross-platform signed integer of length 8 bits (1 byte).

Definition at line 30 of file types.hpp.

typedef int qi::LogContext

Definition at line 112 of file log.hpp.

typedef boost::chrono::duration<int64_t, boost::micro> qi::MicroSeconds

Definition at line 21 of file clock.hpp.

typedef boost::chrono::duration<int64_t, boost::milli> qi::MilliSeconds

Definition at line 22 of file clock.hpp.

typedef boost::chrono::duration<int64_t, boost::ratio<60> > qi::Minutes

Definition at line 24 of file clock.hpp.

typedef boost::chrono::duration<int64_t, boost::nano> qi::NanoSeconds

Definition at line 20 of file clock.hpp.

typedef std::vector<Path> qi::PathVector

Definition at line 24 of file path.hpp.

typedef boost::chrono::duration<int64_t> qi::Seconds

Definition at line 23 of file clock.hpp.

Definition at line 106 of file clock.hpp.

Cross-platform unsigned integer of length 16 bits (2 bytes).

Definition at line 36 of file types.hpp.

Cross-platform unsigned integer of length 32 bits (4 bytes).

Definition at line 37 of file types.hpp.

Cross-platform unsigned integer of length 64 bits (8 bytes).

Definition at line 38 of file types.hpp.

Cross-platform unsigned integer of length 8 bits (1 byte).

Definition at line 35 of file types.hpp.

Definition at line 107 of file clock.hpp.

Enumeration Type Documentation

Enumerator
FutureCallbackType_Sync 
FutureCallbackType_Async 

Definition at line 69 of file future.hpp.

State of the future.

Enumerator
FutureState_None 
FutureState_Running 

Future is not tied to a promise.

FutureState_Canceled 

Operation pending.

FutureState_FinishedWithError 

The future has been canceled.

FutureState_FinishedWithValue 

The operation is finished with an error.

Definition at line 61 of file future.hpp.

Enumerator
FutureTimeout_Infinite 
FutureTimeout_None 

Definition at line 74 of file future.hpp.

Enumerator
LogColor_Never 
LogColor_Auto 
LogColor_Always 

Definition at line 94 of file log.hpp.

Enumerator
LogContextAttr_None 
LogContextAttr_Verbosity 
LogContextAttr_ShortVerbosity 
LogContextAttr_Date 
LogContextAttr_Tid 
LogContextAttr_Category 
LogContextAttr_File 
LogContextAttr_Function 
LogContextAttr_Return 

Definition at line 100 of file log.hpp.

Log level verbosity.

Enumerator
LogLevel_Silent 

silent log level

LogLevel_Fatal 

fatal log level

LogLevel_Error 

error log level

LogLevel_Warning 

warning log level

LogLevel_Info 

info log level

LogLevel_Verbose 

verbose log level

LogLevel_Debug 

debug log level

Definition at line 84 of file log.hpp.

Enumerator
StreamColor_None 
StreamColor_Reset 
StreamColor_Bold 
StreamColor_Faint 
StreamColor_Standout 
StreamColor_Underline 
StreamColor_Blink 
StreamColor_Overline 
StreamColor_Black 
StreamColor_DarkRed 
StreamColor_DarkGreen 
StreamColor_Brown 
StreamColor_DarkBlue 
StreamColor_Purple 
StreamColor_Teal 
StreamColor_LightGray 
StreamColor_DarkGray 
StreamColor_Red 
StreamColor_Green 
StreamColor_Yellow 
StreamColor_Blue 
StreamColor_Fuchsia 
StreamColor_Turquoise 
StreamColor_White 

Definition at line 16 of file iocolor.hpp.

Function Documentation

template<typename FT , typename PT >
void qi::adaptFuture ( const Future< FT > &  f,
Promise< PT > &  p 
)

Feed a promise from a future of possibly different type. Will monitor f, and bounce its state to p. Error and canceled state are bounced as is. Valued state is bounced through FutureValueConverter<FT, PT>::convert()

Definition at line 316 of file future.hxx.

template<typename FT , typename PT , typename CONV >
void qi::adaptFuture ( const Future< FT > &  f,
Promise< PT > &  p,
CONV  converter 
)

Similar to adaptFuture(f, p) but with a custom converter.

Definition at line 326 of file future.hxx.

qi::argc ( )

Deprecated, see detailed description.

Returns
Argument counter of the program if qi::init was called previously.
* .. deprecated:: 1.16
*     Use :cpp:class:`qi::Application::argc()`
* 
Examples:
boost_filesystem_example.cpp, log_example.cpp, qiconvloc_example.cpp, and qipath_example.cpp.
qi::argv ( )

Deprecated, see detailed description.

Returns
Arguments of the program if qi::init was called previously.
* .. deprecated:: 1.16
*     Use :cpp:class:`qi::Application::argv()`
* 
Examples:
boost_filesystem_example.cpp, log_example.cpp, qiconvloc_example.cpp, and qipath_example.cpp.
template<typename RF , typename AF >
boost::function<RF> qi::bind ( const AF &  fun,
  ... 
)

Bind a set of arguments or placeholders to a function.

Handles first function argument of kind boost::weak_ptr and qi::Trackable: will try to lock and throw qi::PointerLockException in case of failure

qi::defaultTranslator ( const std::string &  name)

Get a reference on the default Translator.

Parameters
nameApplication or Library name
Returns
A reference on default qi::Translator
QI_API_DEPRECATED EventLoop* qi::getDefaultNetworkEventLoop ( )

Compat Return a default event loop for network operations.

QI_API_DEPRECATED EventLoop* qi::getDefaultObjectEventLoop ( )

Return a default context for other uses.

QI_API_DEPRECATED EventLoop* qi::getDefaultThreadPoolEventLoop ( )

Return a default thread pool context.

EventLoop* qi::getEventLoop ( )

Return the global eventloop, created on demand on first call.

boost::asio::io_service& qi::getIoService ( )

Return the io_service used by the global event loop.

QI_API_DEPRECATED void qi::init ( int &  argc,
char **&  argv 
)
template<typename T >
bool qi::isClonable ( )
Returns
true if T inherits from boost::noncopyable or uses QI_DISALLOW_COPY_AND_ASSIGN

Definition at line 36 of file traits.hpp.

template<typename T >
bool qi::isClonable ( T *  )

Definition at line 41 of file traits.hpp.

template<typename T >
qi::Future< T > qi::makeFutureError ( const std::string &  error,
FutureCallbackType  async 
)

Definition at line 231 of file future.hxx.

template<typename R >
void qi::nullConverter ( void *  ,
R &   
)

Definition at line 50 of file eventloop.hxx.

qi::program ( )

Deprecated, see detailed description.

Returns
Program name if qi::init was called previously.
* .. deprecated:: 1.16
*     Use :cpp:class:`qi::Application::program()`
* 
void qi::sleepFor ( const qi::Duration d)
template<class Rep , class Period >
void qi::sleepFor ( const boost::chrono::duration< Rep, Period > &  d)
inline

Definition at line 16 of file clock.hxx.

void qi::sleepUntil ( const SteadyClockTimePoint &  t)
template<class Duration >
void qi::sleepUntil ( const boost::chrono::time_point< SteadyClock, Duration > &  t)
inline

Definition at line 22 of file clock.hxx.

void qi::sleepUntil ( const WallClockTimePoint &  t)
template<class Duration >
void qi::sleepUntil ( const boost::chrono::time_point< WallClock, Duration > &  t)
inline

Definition at line 28 of file clock.hxx.

void qi::startEventLoop ( int  nthread)

Start the eventloop with nthread threads. No-op if already started.

SteadyClockTimePoint qi::steadyClockNow ( )
inline

Definition at line 109 of file clock.hpp.

long qi::testAndSet ( long *  cond)
inline

Definition at line 31 of file atomic.hpp.

qi::tr ( const std::string &  msg,
const std::string &  domain = "",
const std::string &  locale = "" 
)

Translate a message.

Parameters
messageMessage
domainDomain name
localeLocale name
Returns
The translated message
template<typename F , typename ARG0 >
boost::function< F > qi::track ( const boost::function< F > &  f,
const ARG0 &  arg0 
)

Wrap given function f with a tracking check on arg0, which must be a weak pointer or a Trackable instance.

Returns
a function that, when called:

Definition at line 193 of file trackable.hxx.

template<typename F , typename ARG0 >
boost::function< F > qi::trackWithFallback ( boost::function< void()>  onFail,
const boost::function< F > &  f,
const ARG0 &  arg0 
)

Definition at line 199 of file trackable.hxx.

qi::unicodeFacet ( )

UTF-8 facet object getter.

Returns
UTF-8 implementation for std::codecvt<wchar_t, char, std::mbstate_t>

Return a facet object that can be used by stl (iostream, locale, ...) and std::locale compliant library like boost::filesystem.

This class allow conversion between UTF-8 (char) and UTF-16/UTF-32 (wchar).

template<typename T >
void qi::waitForAll ( std::vector< Future< T > > &  vect)

Helper function to wait on a vector of futures.

Definition at line 238 of file future.hxx.

template<typename T >
qi::FutureSync< qi::Future< T > > qi::waitForFirst ( std::vector< Future< T > > &  vect)

Helper function to wait for the first valid future.

Definition at line 249 of file future.hxx.

WallClockTimePoint qi::wallClockNow ( )
inline

Definition at line 113 of file clock.hpp.