Classes | |
class | clan::BlockAllocated |
Class with operator new/delete overloads for BlockAllocator. More... | |
class | clan::BlockAllocator |
Memory allocator that allocates in blocks. More... | |
class | clan::ConsoleWindow |
Text console window. More... | |
class | clan::DataBuffer |
General purpose data buffer. More... | |
class | clan::DateTime |
Date/Time class. More... | |
class | clan::Event |
OS level event. More... | |
class | clan::EventProvider |
OS level event provider. More... | |
class | clan::Exception |
Top-level exception class. More... | |
class | clan::GameTime |
Tracks time elapsed in various forms useful for games. More... | |
class | clan::Mutex |
Mutex class. More... | |
class | clan::MutexSection |
Mutex locking helper. More... | |
class | clan::Runnable |
Thread runnable object. More... | |
class | clan::RunnableMember_v0< C > |
(Internal ClanLib Class) More... | |
class | clan::RunnableMember_v1< C, P1 > |
(Internal ClanLib Class) More... | |
class | clan::RunnableMember_v2< C, P1, P2 > |
(Internal ClanLib Class) More... | |
class | clan::RunnableMember_v3< C, P1, P2, P3 > |
(Internal ClanLib Class) More... | |
class | clan::RunnableMember_v4< C, P1, P2, P3, P4 > |
(Internal ClanLib Class) More... | |
class | clan::RunnableMember_v5< C, P1, P2, P3, P4, P5 > |
(Internal ClanLib Class) More... | |
class | clan::Service |
Service/daemon class. More... | |
class | clan::SetupCore |
Library initializer class. More... | |
class | clan::System |
General system helper functions. More... | |
class | clan::Thread |
Thread class. More... | |
class | clan::ThreadLocalStorage |
Thread class. More... | |
class | clan::ThreadLocalStorageData |
class | clan::UserData< T > |
class | clan::UserDataBase |
class | clan::UserDataOwner |
Helper class to store any shared_ptr as user data on an object. More... | |
class | clan::WorkItem |
Interface for executing work on a worker thread. More... | |
class | clan::WorkQueue |
Thread pool for worker threads. More... | |
Macros | |
#define | cl_tls_variable __thread |
Typedefs | |
typedef short | clan::byte16 |
typedef int | clan::byte32 |
typedef long long | clan::byte64 |
typedef char | clan::byte8 |
typedef unsigned short | clan::ubyte16 |
typedef unsigned int | clan::ubyte32 |
typedef unsigned long long | clan::ubyte64 |
typedef unsigned char | clan::ubyte8 |
Functions | |
clan::UserData< T >::UserData (const std::shared_ptr< T > &data) | |
clan::UserDataOwner::UserDataOwner () | |
clan::WorkQueue::WorkQueue (bool serial_queue=false) | |
Constructs a work queue. More... | |
virtual | clan::ThreadLocalStorageData::~ThreadLocalStorageData () |
virtual | clan::UserDataBase::~UserDataBase () |
clan::UserDataOwner::~UserDataOwner () | |
virtual | clan::WorkItem::~WorkItem () |
clan::WorkQueue::~WorkQueue () | |
template<typename T > | |
std::shared_ptr< T > | clan::UserDataOwner::get_data () |
virtual void | clan::WorkItem::process_work ()=0 |
Called by a worker thread to process work. More... | |
void | clan::WorkQueue::queue (WorkItem *item) |
Queue some work to be executed on a worker thread. More... | |
void | clan::WorkQueue::queue (const std::function< void()> &func) |
Queue some work to be executed on a worker thread. More... | |
template<typename T > | |
void | clan::UserDataOwner::set_data (const std::shared_ptr< T > &data) |
virtual void | clan::WorkItem::work_completed () |
Called by the WorkQueue thread to complete the work. More... | |
void | clan::WorkQueue::work_completed (const std::function< void()> &func) |
Queue some work to be executed on the main WorkQueue thread. More... | |
Variables | |
std::shared_ptr< T > | clan::UserData< T >::data |
const float | clan::PI = 3.14159274101257f |
const double | clan::PI_D = 3.141592653589793115998 |
const float | clan::PI_F = 3.14159274101257f |
Friends | |
class | clan::ThreadLocalStorage::SetupCore_Impl |
Construction | |
clan::BlockAllocator::BlockAllocator () | |
Block Allocator constructor. More... | |
Operations | |
void * | clan::BlockAllocator::allocate (int size) |
Allocate memory (See note on this class for the allocation method) More... | |
void | clan::BlockAllocator::free () |
Free the allocated memory. More... | |
Operations | |
void * | clan::BlockAllocated::operator new (size_t size, BlockAllocator *allocator) |
void | clan::BlockAllocated::operator delete (void *data, size_t size) |
void | clan::BlockAllocated::operator delete (void *data, BlockAllocator *allocator) |
Construction | |
clan::ConsoleWindow::ConsoleWindow (const std::string &title, int width=80, int height=25) | |
Console Window constructor. More... | |
clan::ConsoleWindow::~ConsoleWindow () | |
Console Window destructor. More... | |
Operations | |
void | clan::ConsoleWindow::wait_for_key () |
Waits until user hits a key. More... | |
void | clan::ConsoleWindow::display_close_message () |
Displays 'press any key to close this console window',. More... | |
Construction | |
clan::DataBuffer::DataBuffer () | |
Constructs a data buffer of 0 size. More... | |
clan::DataBuffer::DataBuffer (unsigned int size) | |
clan::DataBuffer::DataBuffer (const void *data, unsigned int size) | |
clan::DataBuffer::DataBuffer (const DataBuffer &data, unsigned int pos, unsigned int size) | |
clan::DataBuffer::~DataBuffer () | |
Attributes | |
char * | clan::DataBuffer::get_data () |
Returns a pointer to the data. More... | |
const char * | clan::DataBuffer::get_data () const |
template<typename Type > | |
Type * | clan::DataBuffer::get_data () |
template<typename Type > | |
const Type * | clan::DataBuffer::get_data () const |
unsigned int | clan::DataBuffer::get_size () const |
Returns the size of the data. More... | |
unsigned int | clan::DataBuffer::get_capacity () const |
Returns the capacity of the data buffer object. More... | |
char & | clan::DataBuffer::operator[] (int i) |
Returns a char in the buffer. More... | |
const char & | clan::DataBuffer::operator[] (int i) const |
char & | clan::DataBuffer::operator[] (unsigned int i) |
const char & | clan::DataBuffer::operator[] (unsigned int i) const |
bool | clan::DataBuffer::is_null () const |
Returns true if the buffer is 0 in size. More... | |
Operations | |
DataBuffer & | clan::DataBuffer::operator= (const DataBuffer ©) |
void | clan::DataBuffer::set_size (unsigned int size) |
Resize the buffer. More... | |
void | clan::DataBuffer::set_capacity (unsigned int capacity) |
Preallocate enough memory. More... | |
Construction | |
enum | clan::DateTime::TimeZone { clan::DateTime::local_timezone, clan::DateTime::utc_timezone } |
clan::DateTime::DateTime () | |
Constructs a date/time object. More... | |
clan::DateTime::DateTime (int year, int month, int day, int hour=0, int minute=0, int seconds=0, int nanoseconds=0, TimeZone timezone=utc_timezone) | |
clan::DateTime::~DateTime () | |
static DateTime | clan::DateTime::get_current_local_time () |
Get current system time in local time zone. More... | |
static DateTime | clan::DateTime::get_current_utc_time () |
Get current system time in UTC. More... | |
static DateTime | clan::DateTime::get_local_time_from_ticks (byte64 ticks) |
Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in the local time zone. More... | |
static DateTime | clan::DateTime::get_utc_time_from_ticks (byte64 ticks) |
Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in UTC. More... | |
static DateTime | clan::DateTime::from_short_date_string (const std::string &value) |
Attributes | |
bool | clan::DateTime::is_null () const |
unsigned short | clan::DateTime::get_year () const |
unsigned char | clan::DateTime::get_month () const |
Returns the month number in range 1-12. More... | |
unsigned char | clan::DateTime::get_day () const |
unsigned char | clan::DateTime::get_hour () const |
unsigned char | clan::DateTime::get_minutes () const |
unsigned char | clan::DateTime::get_seconds () const |
unsigned int | clan::DateTime::get_nanoseconds () const |
TimeZone | clan::DateTime::get_timezone () const |
unsigned char | clan::DateTime::get_week () const |
Returns the ISO 8601 week number of the date. More... | |
int | clan::DateTime::get_difference_in_days (const DateTime &other) const |
Returns the difference in days between two dates. This function is only accurate for the next few millenniums. More... | |
unsigned int | clan::DateTime::get_day_of_week () const |
Get the day of the week. More... | |
static int | clan::DateTime::get_days_in_month (int month, int year) |
Returns the number of days in the given month. More... | |
Operations | |
void | clan::DateTime::set_null () |
void | clan::DateTime::set_date (int year, int month, int day, int hour=0, int minute=0, int seconds=0, int nanoseconds=0, TimeZone timezone=utc_timezone) |
void | clan::DateTime::set_year (int year) |
void | clan::DateTime::set_month (int month) |
void | clan::DateTime::set_day (int day) |
void | clan::DateTime::set_hour (int hour) |
void | clan::DateTime::set_minutes (int minutes) |
void | clan::DateTime::set_seconds (int seconds) |
void | clan::DateTime::set_nanoseconds (int nanoseconds) |
void | clan::DateTime::set_timezone (TimeZone timezone) |
DateTime & | clan::DateTime::add_years (int years) |
DateTime & | clan::DateTime::add_days (int days) |
DateTime & | clan::DateTime::add_months (int months) |
DateTime | clan::DateTime::to_utc () const |
DateTime | clan::DateTime::to_local () const |
byte64 | clan::DateTime::to_ticks () const |
Converts the date to the number of 100-nanosecond intervals since January 1, 1601 UTC. More... | |
std::string | clan::DateTime::to_long_date_string () const |
Mon Mar 3 2007. More... | |
std::string | clan::DateTime::to_short_date_string () const |
yyyy-mm-dd More... | |
std::string | clan::DateTime::to_short_datetime_string () const |
yyyy-mm-dd hh:mm:ss More... | |
std::string | clan::DateTime::to_long_time_string () const |
hh:mm:ss More... | |
std::string | clan::DateTime::to_short_time_string () const |
hh:mm More... | |
std::string | clan::DateTime::to_string () const |
Mon Feb 3 12:32:54 2008. More... | |
bool | clan::DateTime::operator< (const DateTime &other) const |
bool | clan::DateTime::operator<= (const DateTime &other) const |
bool | clan::DateTime::operator> (const DateTime &other) const |
bool | clan::DateTime::operator>= (const DateTime &other) const |
bool | clan::DateTime::operator== (const DateTime &other) const |
bool | clan::DateTime::operator!= (const DateTime &other) const |
Construction | |
virtual | clan::EventProvider::~EventProvider () |
Attributes | |
enum | clan::EventProvider::EventType { clan::EventProvider::type_fd_read, clan::EventProvider::type_fd_write, clan::EventProvider::type_fd_exception } |
virtual EventType | clan::EventProvider::get_event_type (int index)=0 |
Returns the type of event provided. More... | |
virtual int | clan::EventProvider::get_event_handle (int index)=0 |
Returns the OS handle for the event. More... | |
virtual int | clan::EventProvider::get_num_event_handles ()=0 |
Returns the number of OS handles relevant for this event. More... | |
Operations | |
virtual bool | clan::EventProvider::check_before_wait () |
Prepare for OS event waiting. More... | |
virtual bool | clan::EventProvider::check_after_wait (int) |
Check for flagging after OS event waiting. More... | |
virtual bool | clan::EventProvider::set () |
Raise flag. More... | |
virtual bool | clan::EventProvider::reset () |
Reset flag. More... | |
Construction | |
clan::Exception::Exception (const std::string &message) | |
Constructs an exception object. More... | |
virtual | clan::Exception::~Exception () throw () |
Destructs an exception object. More... | |
Attributes | |
std::string | clan::Exception::message |
Description of exception. More... | |
virtual const char * | clan::Exception::what () const throw () |
Returns description of exception. More... | |
Operations | |
std::vector< std::string > | clan::Exception::get_stack_trace () const |
Returns the call stack present when the exception object was created. More... | |
std::string | clan::Exception::get_message_and_stack_trace () const |
Returns the message and call stack present when the exception object was created, formatted using newlines. More... | |
Construction | |
clan::GameTime::GameTime (int ticks_per_second=20, int max_updates_per_second=0) | |
GameTime constructor. More... | |
Attributes | |
float | clan::GameTime::get_time_elapsed () const |
Returns the time elapsed in seconds since last update. More... | |
int | clan::GameTime::get_time_elapsed_ms () const |
Returns the time elapsed in seconds since last update in milliseconds. More... | |
int | clan::GameTime::get_ticks_elapsed () const |
Returns the number of ticks that elapsed since last update. More... | |
float | clan::GameTime::get_tick_time_elapsed () const |
Returns the time elapsed per tick. More... | |
int | clan::GameTime::get_tick_time_elapsed_ms () const |
Returns the time elapsed per tick in milliseconds. More... | |
float | clan::GameTime::get_tick_interpolation_time () const |
Returns the current time between ticks as a normalized number. More... | |
float | clan::GameTime::get_updates_per_second () const |
Returns the number of updates that occurred every second (aka fps, frames per second) More... | |
float | clan::GameTime::get_current_time () const |
Returns the number of seconds since this class was reset() More... | |
ubyte64 | clan::GameTime::get_current_time_microseconds () const |
Returns the number of microseconds since this class was reset() More... | |
ubyte64 | clan::GameTime::get_current_time_ms () const |
Returns the number of milliseconds since this class was reset() More... | |
Operations | |
void | clan::GameTime::update () |
Updates time data for the frame to be rendered. More... | |
void | clan::GameTime::reset () |
Resets the timer. More... | |
Construction | |
clan::Mutex::Mutex () | |
Constructs a mutex object. More... | |
clan::Mutex::~Mutex () | |
Operations | |
void | clan::Mutex::lock () |
Lock mutex. More... | |
bool | clan::Mutex::try_lock () |
Attempt to lock mutex. More... | |
void | clan::Mutex::unlock () |
Unlock mutex. More... | |
Construction | |
clan::MutexSection::MutexSection (Mutex *mutex, bool lock_mutex=true) | |
Constructs a mutex section. More... | |
clan::MutexSection::~MutexSection () | |
Attributes | |
int | clan::MutexSection::get_lock_count () const |
Returns the amounts of recursive mutex locks performed by this section. More... | |
Operations | |
void | clan::MutexSection::lock () |
Lock the mutex. More... | |
bool | clan::MutexSection::try_lock () |
Attempt to lock mutex. More... | |
void | clan::MutexSection::unlock () |
Unlock mutex. More... | |
Construction | |
clan::Runnable::Runnable () | |
virtual | clan::Runnable::~Runnable () |
Operations | |
virtual void | clan::Runnable::run ()=0 |
static void | clan::Runnable::set_thread_name (const char *name) |
Sets the name (displayed in debuggers) of the calling thread. More... | |
Construction | |
typedef void(C::* | clan::RunnableMember_v0< C >::PtrMemberFunc )() |
clan::RunnableMember_v0< C >::RunnableMember_v0 (C *instance, PtrMemberFunc func) | |
Operations | |
virtual void | clan::RunnableMember_v0< C >::run () |
Construction | |
typedef void(C::* | clan::RunnableMember_v1< C, P1 >::PtrMemberFunc )(P1 p1) |
clan::RunnableMember_v1< C, P1 >::RunnableMember_v1 (C *instance, PtrMemberFunc func, P1 p1) | |
Operations | |
virtual void | clan::RunnableMember_v1< C, P1 >::run () |
Construction | |
typedef void(C::* | clan::RunnableMember_v2< C, P1, P2 >::PtrMemberFunc )(P1 p1, P2 p2) |
clan::RunnableMember_v2< C, P1, P2 >::RunnableMember_v2 (C *instance, PtrMemberFunc func, P1 p1, P2 p2) | |
Operations | |
virtual void | clan::RunnableMember_v2< C, P1, P2 >::run () |
Construction | |
typedef void(C::* | clan::RunnableMember_v3< C, P1, P2, P3 >::PtrMemberFunc )(P1 p1, P2 p2, P3 p3) |
clan::RunnableMember_v3< C, P1, P2, P3 >::RunnableMember_v3 (C *instance, PtrMemberFunc func, P1 p1, P2 p2, P3 p3) | |
Operations | |
virtual void | clan::RunnableMember_v3< C, P1, P2, P3 >::run () |
Construction | |
typedef void(C::* | clan::RunnableMember_v4< C, P1, P2, P3, P4 >::PtrMemberFunc )(P1 p1, P2 p2, P3 p3, P4 p4) |
clan::RunnableMember_v4< C, P1, P2, P3, P4 >::RunnableMember_v4 (C *instance, PtrMemberFunc func, P1 p1, P2 p2, P3 p3, P4 p4) | |
Operations | |
virtual void | clan::RunnableMember_v4< C, P1, P2, P3, P4 >::run () |
Construction | |
typedef void(C::* | clan::RunnableMember_v5< C, P1, P2, P3, P4, P5 >::PtrMemberFunc )(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) |
clan::RunnableMember_v5< C, P1, P2, P3, P4, P5 >::RunnableMember_v5 (C *instance, PtrMemberFunc func, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) | |
Operations | |
virtual void | clan::RunnableMember_v5< C, P1, P2, P3, P4, P5 >::run () |
Construction | |
clan::Service::Service (const std::string &service_name) | |
Constructs a service object. More... | |
clan::Service::~Service () | |
Attributes | |
const std::string & | clan::Service::get_service_name () const |
Returns the service name. More... | |
Operations | |
int | clan::Service::main (int argc, char **argv) |
Process command line and run service. More... | |
virtual void | clan::Service::service_start (std::vector< std::string > &args)=0 |
Called when the service is asked to start. More... | |
virtual void | clan::Service::service_stop ()=0 |
Called when the service is asked to stop. More... | |
virtual void | clan::Service::service_reload ()=0 |
Called when the service is asked to reload its configuration. More... | |
Implementation | |
class | clan::Service::Service_Impl |
Construction | |
clan::SetupCore::SetupCore () | |
Initializes clanCore. More... | |
clan::SetupCore::~SetupCore () | |
Attributes | |
enum | clan::System::CPU_ExtensionX86 { clan::System::mmx, clan::System::mmx_ex, clan::System::_3d_now, clan::System::_3d_now_ex, clan::System::sse, clan::System::sse2, clan::System::sse3, clan::System::ssse3, clan::System::sse4_a, clan::System::sse4_1, clan::System::sse4_2, clan::System::xop, clan::System::avx, clan::System::aes, clan::System::fma3, clan::System::fma4 } |
enum | clan::System::CPU_ExtensionPPC { clan::System::altivec } |
static ubyte64 | clan::System::get_time () |
Get the current time (since system boot), in milliseconds. More... | |
static ubyte64 | clan::System::get_microseconds () |
Get the current time microseconds. More... | |
static bool | clan::System::detect_cpu_extension (CPU_ExtensionX86 ext) |
static bool | clan::System::detect_cpu_extension (CPU_ExtensionPPC ext) |
static int | clan::System::get_num_cores () |
Return the number of CPU cores. More... | |
Operations | |
static void * | clan::System::aligned_alloc (size_t size, size_t alignment=16) |
Allocates aligned memory. More... | |
static void | clan::System::aligned_free (void *ptr) |
Frees aligned memory. More... | |
static int | clan::System::capture_stack_trace (int frames_to_skip, int max_frames, void **out_frames, unsigned int *out_hash=0) |
Captures a stack back trace by walking up the stack and recording the information for each frame. More... | |
static std::vector< std::string > | clan::System::get_stack_frames_text (void **frames, int num_frames) |
Returns the function names and lines for the specified stack frame addresses. More... | |
static void | clan::System::sleep (int millis) |
Sleep for 'millis' milliseconds. More... | |
static void | clan::System::pause (int millis) |
Pause for 'millis' milliseconds. More... | |
static std::string | clan::System::get_exe_path () |
Returns the full dirname of the executable that started this. More... | |
Construction | |
clan::Thread::Thread () | |
Constructs a thread object. More... | |
clan::Thread::~Thread () | |
Operations | |
void | clan::Thread::start (Runnable *runnable) |
Starts a thread. More... | |
template<class C > | |
void | clan::Thread::start (C *instance, void(C::*member)()) |
template<class C , class P1 > | |
void | clan::Thread::start (C *instance, void(C::*member)(P1 p1), P1 p1) |
template<class C , class P1 , class P2 > | |
void | clan::Thread::start (C *instance, void(C::*member)(P1 p1, P2 p2), P1 p1, P2 p2) |
template<class C , class P1 , class P2 , class P3 > | |
void | clan::Thread::start (C *instance, void(C::*member)(P1 p1, P2 p2, P3 p3), P1 p1, P2 p2, P3 p3) |
template<class C , class P1 , class P2 , class P3 , class P4 > | |
void | clan::Thread::start (C *instance, void(C::*member)(P1 p1, P2 p2, P3 p3, P4 p4), P1 p1, P2 p2, P3 p3, P4 p4) |
template<class C , class P1 , class P2 , class P3 , class P4 , class P5 > | |
void | clan::Thread::start (C *instance, void(C::*member)(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) |
void | clan::Thread::join () |
Blocks until thread has completed its execution. More... | |
void | clan::Thread::kill () |
Terminates the thread. More... | |
static void | clan::Thread::set_thread_name (const char *name) |
Sets the name (displayed in debuggers) of the calling thread. More... | |
Construction | |
clan::ThreadLocalStorage::ThreadLocalStorage () | |
Constructs a Thread Local Storage object. More... | |
clan::ThreadLocalStorage::~ThreadLocalStorage () | |
Attributes | |
static std::shared_ptr < ThreadLocalStorageData > | clan::ThreadLocalStorage::get_variable (const std::string &name) |
Get a variable. More... | |
Operations | |
static void | clan::ThreadLocalStorage::set_variable (const std::string &name, std::shared_ptr< ThreadLocalStorageData > ptr) |
Set a variable. More... | |
#define cl_tls_variable __thread |
typedef short clan::byte16 |
typedef int clan::byte32 |
typedef long long clan::byte64 |
typedef char clan::byte8 |
typedef void(C::* clan::RunnableMember_v0< C >::PtrMemberFunc)() |
typedef void(C::* clan::RunnableMember_v1< C, P1 >::PtrMemberFunc)(P1 p1) |
typedef void(C::* clan::RunnableMember_v2< C, P1, P2 >::PtrMemberFunc)(P1 p1, P2 p2) |
typedef void(C::* clan::RunnableMember_v3< C, P1, P2, P3 >::PtrMemberFunc)(P1 p1, P2 p2, P3 p3) |
typedef void(C::* clan::RunnableMember_v4< C, P1, P2, P3, P4 >::PtrMemberFunc)(P1 p1, P2 p2, P3 p3, P4 p4) |
typedef void(C::* clan::RunnableMember_v5< C, P1, P2, P3, P4, P5 >::PtrMemberFunc)(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) |
typedef unsigned short clan::ubyte16 |
typedef unsigned int clan::ubyte32 |
typedef unsigned long long clan::ubyte64 |
typedef unsigned char clan::ubyte8 |
clan::BlockAllocator::BlockAllocator | ( | ) |
Block Allocator constructor.
clan::ConsoleWindow::ConsoleWindow | ( | const std::string & | title, |
int | width = 80 , |
||
int | height = 25 |
||
) |
clan::DataBuffer::DataBuffer | ( | ) |
Constructs a data buffer of 0 size.
clan::DataBuffer::DataBuffer | ( | unsigned int | size | ) |
clan::DataBuffer::DataBuffer | ( | const void * | data, |
unsigned int | size | ||
) |
clan::DataBuffer::DataBuffer | ( | const DataBuffer & | data, |
unsigned int | pos, | ||
unsigned int | size | ||
) |
clan::DateTime::DateTime | ( | ) |
Constructs a date/time object.
clan::DateTime::DateTime | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour = 0 , |
||
int | minute = 0 , |
||
int | seconds = 0 , |
||
int | nanoseconds = 0 , |
||
TimeZone | timezone = utc_timezone |
||
) |
clan::Exception::Exception | ( | const std::string & | message | ) |
Constructs an exception object.
clan::GameTime::GameTime | ( | int | ticks_per_second = 20 , |
int | max_updates_per_second = 0 |
||
) |
GameTime constructor.
ticks_per_second | = Number of ticks per second |
max_updates_per_second | = Maximum number of updates per second (aka FPS, frames per second). 0 = Unlimited |
clan::Mutex::Mutex | ( | ) |
Constructs a mutex object.
|
inline |
Constructs a mutex section.
clan::Runnable::Runnable | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
clan::Service::Service | ( | const std::string & | service_name | ) |
Constructs a service object.
clan::SetupCore::SetupCore | ( | ) |
Initializes clanCore.
clan::Thread::Thread | ( | ) |
Constructs a thread object.
clan::ThreadLocalStorage::ThreadLocalStorage | ( | ) |
Constructs a Thread Local Storage object.
|
inline |
|
inline |
clan::WorkQueue::WorkQueue | ( | bool | serial_queue = false | ) |
Constructs a work queue.
serial_queue | If true, executes items in the order they are queued, one at a time |
clan::DataBuffer::~DataBuffer | ( | ) |
clan::DateTime::~DateTime | ( | ) |
|
inlinevirtual |
|
inlinevirtual |
Destructs an exception object.
clan::Mutex::~Mutex | ( | ) |
|
inline |
|
virtual |
clan::Service::~Service | ( | ) |
clan::SetupCore::~SetupCore | ( | ) |
clan::Thread::~Thread | ( | ) |
clan::ThreadLocalStorage::~ThreadLocalStorage | ( | ) |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inlinevirtual |
clan::WorkQueue::~WorkQueue | ( | ) |
DateTime& clan::DateTime::add_days | ( | int | days | ) |
DateTime& clan::DateTime::add_months | ( | int | months | ) |
DateTime& clan::DateTime::add_years | ( | int | years | ) |
|
static |
Allocates aligned memory.
|
static |
Frees aligned memory.
void* clan::BlockAllocator::allocate | ( | int | size | ) |
Allocate memory (See note on this class for the allocation method)
param: size = Size to allocate (in bytes)
|
static |
Captures a stack back trace by walking up the stack and recording the information for each frame.
|
inlinevirtual |
Check for flagging after OS event waiting.
|
inlinevirtual |
Prepare for OS event waiting.
|
static |
|
static |
void clan::ConsoleWindow::display_close_message | ( | ) |
Displays 'press any key to close this console window',.
and waits until user hits a key.
This function does not do anything on Linux.
void clan::BlockAllocator::free | ( | ) |
Free the allocated memory.
If required, use delete_obj() to call the destructor before using this function
|
static |
unsigned int clan::DataBuffer::get_capacity | ( | ) | const |
Returns the capacity of the data buffer object.
|
static |
Get current system time in local time zone.
float clan::GameTime::get_current_time | ( | ) | const |
Returns the number of seconds since this class was reset()
ubyte64 clan::GameTime::get_current_time_microseconds | ( | ) | const |
Returns the number of microseconds since this class was reset()
ubyte64 clan::GameTime::get_current_time_ms | ( | ) | const |
Returns the number of milliseconds since this class was reset()
|
static |
Get current system time in UTC.
char* clan::DataBuffer::get_data | ( | ) |
Returns a pointer to the data.
const char* clan::DataBuffer::get_data | ( | ) | const |
|
inline |
References clan::DataBuffer::get_data().
Referenced by clan::DataBuffer::get_data().
|
inline |
References clan::DataBuffer::get_data().
Referenced by clan::DataBuffer::get_data().
|
inline |
References clan::UserData< T >::data.
unsigned char clan::DateTime::get_day | ( | ) | const |
unsigned int clan::DateTime::get_day_of_week | ( | ) | const |
Get the day of the week.
|
static |
Returns the number of days in the given month.
int clan::DateTime::get_difference_in_days | ( | const DateTime & | other | ) | const |
Returns the difference in days between two dates. This function is only accurate for the next few millenniums.
|
pure virtual |
Returns the OS handle for the event.
|
pure virtual |
Returns the type of event provided.
|
static |
Returns the full dirname of the executable that started this.
process (aka argv[0])
This is necessary since when programms are started from the PATH there is no clean and simple way to figure out the location of the data files, thus information is read from /proc/self/exe
under GNU/Linux and from GetModuleFileName() on Win32.
unsigned char clan::DateTime::get_hour | ( | ) | const |
|
static |
Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in the local time zone.
|
inline |
Returns the amounts of recursive mutex locks performed by this section.
std::string clan::Exception::get_message_and_stack_trace | ( | ) | const |
Returns the message and call stack present when the exception object was created, formatted using newlines.
On Linux, to obtain function names, remember to link with the -rdynamic flag
|
static |
Get the current time microseconds.
unsigned char clan::DateTime::get_minutes | ( | ) | const |
unsigned char clan::DateTime::get_month | ( | ) | const |
Returns the month number in range 1-12.
unsigned int clan::DateTime::get_nanoseconds | ( | ) | const |
|
static |
Return the number of CPU cores.
|
pure virtual |
Returns the number of OS handles relevant for this event.
unsigned char clan::DateTime::get_seconds | ( | ) | const |
const std::string& clan::Service::get_service_name | ( | ) | const |
Returns the service name.
unsigned int clan::DataBuffer::get_size | ( | ) | const |
Returns the size of the data.
|
static |
Returns the function names and lines for the specified stack frame addresses.
On Linux, to obtain function names, remember to link with the -rdynamic flag
std::vector<std::string> clan::Exception::get_stack_trace | ( | ) | const |
Returns the call stack present when the exception object was created.
On Linux, to obtain function names, remember to link with the -rdynamic flag
float clan::GameTime::get_tick_interpolation_time | ( | ) | const |
Returns the current time between ticks as a normalized number.
If the current time is half-way between two tick updates this function returns 0.5, at the start of a tick its 0.0, and at the end its 1.0.
float clan::GameTime::get_tick_time_elapsed | ( | ) | const |
Returns the time elapsed per tick.
int clan::GameTime::get_tick_time_elapsed_ms | ( | ) | const |
Returns the time elapsed per tick in milliseconds.
int clan::GameTime::get_ticks_elapsed | ( | ) | const |
Returns the number of ticks that elapsed since last update.
|
static |
Get the current time (since system boot), in milliseconds.
float clan::GameTime::get_time_elapsed | ( | ) | const |
Returns the time elapsed in seconds since last update.
int clan::GameTime::get_time_elapsed_ms | ( | ) | const |
Returns the time elapsed in seconds since last update in milliseconds.
TimeZone clan::DateTime::get_timezone | ( | ) | const |
float clan::GameTime::get_updates_per_second | ( | ) | const |
Returns the number of updates that occurred every second (aka fps, frames per second)
|
static |
Converts a time tick value (number of 100-nanosecond intervals since January 1, 1601 UTC) to a date time in UTC.
|
static |
Get a variable.
unsigned char clan::DateTime::get_week | ( | ) | const |
Returns the ISO 8601 week number of the date.
unsigned short clan::DateTime::get_year | ( | ) | const |
bool clan::DateTime::is_null | ( | ) | const |
bool clan::DataBuffer::is_null | ( | ) | const |
Returns true if the buffer is 0 in size.
void clan::Thread::join | ( | ) |
Blocks until thread has completed its execution.
void clan::Thread::kill | ( | ) |
Terminates the thread.
Warning: This is a dangerous function that should only be used in the most extreme cases. If the target thread owns a critical section, the critical section will not be released. If the target thread is allocating memory from the heap, the heap lock will not be released. Windows XP/2000: The target thread's initial stack is not freed, causing a resource leak.
void clan::Mutex::lock | ( | ) |
Lock mutex.
|
inline |
Lock the mutex.
int clan::Service::main | ( | int | argc, |
char ** | argv | ||
) |
Process command line and run service.
void clan::BlockAllocated::operator delete | ( | void * | data, |
size_t | size | ||
) |
void clan::BlockAllocated::operator delete | ( | void * | data, |
BlockAllocator * | allocator | ||
) |
void* clan::BlockAllocated::operator new | ( | size_t | size, |
BlockAllocator * | allocator | ||
) |
bool clan::DateTime::operator!= | ( | const DateTime & | other | ) | const |
bool clan::DateTime::operator< | ( | const DateTime & | other | ) | const |
bool clan::DateTime::operator<= | ( | const DateTime & | other | ) | const |
DataBuffer& clan::DataBuffer::operator= | ( | const DataBuffer & | copy | ) |
bool clan::DateTime::operator== | ( | const DateTime & | other | ) | const |
bool clan::DateTime::operator> | ( | const DateTime & | other | ) | const |
bool clan::DateTime::operator>= | ( | const DateTime & | other | ) | const |
char& clan::DataBuffer::operator[] | ( | int | i | ) |
Returns a char in the buffer.
const char& clan::DataBuffer::operator[] | ( | int | i | ) | const |
char& clan::DataBuffer::operator[] | ( | unsigned int | i | ) |
const char& clan::DataBuffer::operator[] | ( | unsigned int | i | ) | const |
|
static |
Pause for 'millis' milliseconds.
This function acts as sleep, but the function "may" perform a spinlock on some operating systems to give a more accurate pause. This may have a side effect of causing 100% cpu usage. If you do not require an accurate pause, use sleep instead.
|
pure virtual |
Called by a worker thread to process work.
void clan::WorkQueue::queue | ( | WorkItem * | item | ) |
Queue some work to be executed on a worker thread.
Transfers ownership of the item queued. WorkQueue will delete the item.
void clan::WorkQueue::queue | ( | const std::function< void()> & | func | ) |
Queue some work to be executed on a worker thread.
|
inlinevirtual |
Reset flag.
void clan::GameTime::reset | ( | ) |
Resets the timer.
|
pure virtual |
|
inlinevirtual |
Implements clan::Runnable.
References clan::Runnable::set_thread_name().
|
inlinevirtual |
Implements clan::Runnable.
References clan::Runnable::set_thread_name().
|
inlinevirtual |
Implements clan::Runnable.
References clan::Runnable::set_thread_name().
|
inlinevirtual |
Implements clan::Runnable.
References clan::Runnable::set_thread_name().
|
inlinevirtual |
Implements clan::Runnable.
References clan::Runnable::set_thread_name().
|
inlinevirtual |
Implements clan::Runnable.
References clan::Runnable::set_thread_name().
|
protectedpure virtual |
Called when the service is asked to reload its configuration.
|
protectedpure virtual |
Called when the service is asked to start.
|
protectedpure virtual |
Called when the service is asked to stop.
|
inlinevirtual |
Raise flag.
void clan::DataBuffer::set_capacity | ( | unsigned int | capacity | ) |
Preallocate enough memory.
|
inline |
void clan::DateTime::set_date | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour = 0 , |
||
int | minute = 0 , |
||
int | seconds = 0 , |
||
int | nanoseconds = 0 , |
||
TimeZone | timezone = utc_timezone |
||
) |
void clan::DateTime::set_day | ( | int | day | ) |
void clan::DateTime::set_hour | ( | int | hour | ) |
void clan::DateTime::set_minutes | ( | int | minutes | ) |
void clan::DateTime::set_month | ( | int | month | ) |
void clan::DateTime::set_nanoseconds | ( | int | nanoseconds | ) |
void clan::DateTime::set_null | ( | ) |
void clan::DateTime::set_seconds | ( | int | seconds | ) |
void clan::DataBuffer::set_size | ( | unsigned int | size | ) |
Resize the buffer.
|
static |
Sets the name (displayed in debuggers) of the calling thread.
Currently this only works with the Visual Studio compiler and debugger.
Referenced by clan::RunnableMember_v0< C >::run(), clan::RunnableMember_v1< C, P1 >::run(), clan::RunnableMember_v2< C, P1, P2 >::run(), clan::RunnableMember_v3< C, P1, P2, P3 >::run(), clan::RunnableMember_v4< C, P1, P2, P3, P4 >::run(), and clan::RunnableMember_v5< C, P1, P2, P3, P4, P5 >::run().
|
static |
Sets the name (displayed in debuggers) of the calling thread.
Currently this only works with the Visual Studio compiler and debugger.
void clan::DateTime::set_timezone | ( | TimeZone | timezone | ) |
|
static |
Set a variable.
void clan::DateTime::set_year | ( | int | year | ) |
|
static |
Sleep for 'millis' milliseconds.
It is possible for this function to sleep for more than millis, depending on the OS scheduler. If you require a more accurate sleep, consider pause.
void clan::Thread::start | ( | Runnable * | runnable | ) |
Starts a thread.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
DateTime clan::DateTime::to_local | ( | ) | const |
std::string clan::DateTime::to_long_date_string | ( | ) | const |
Mon Mar 3 2007.
std::string clan::DateTime::to_long_time_string | ( | ) | const |
hh:mm:ss
std::string clan::DateTime::to_short_date_string | ( | ) | const |
yyyy-mm-dd
std::string clan::DateTime::to_short_datetime_string | ( | ) | const |
yyyy-mm-dd hh:mm:ss
std::string clan::DateTime::to_short_time_string | ( | ) | const |
hh:mm
std::string clan::DateTime::to_string | ( | ) | const |
Mon Feb 3 12:32:54 2008.
byte64 clan::DateTime::to_ticks | ( | ) | const |
Converts the date to the number of 100-nanosecond intervals since January 1, 1601 UTC.
DateTime clan::DateTime::to_utc | ( | ) | const |
bool clan::Mutex::try_lock | ( | ) |
Attempt to lock mutex.
|
inline |
Attempt to lock mutex.
void clan::Mutex::unlock | ( | ) |
Unlock mutex.
|
inline |
Unlock mutex.
void clan::GameTime::update | ( | ) |
Updates time data for the frame to be rendered.
Call this function once at the start of a frame.
void clan::ConsoleWindow::wait_for_key | ( | ) |
Waits until user hits a key.
This function does not do anything on Linux.
|
virtual |
Returns description of exception.
|
inlinevirtual |
Called by the WorkQueue thread to complete the work.
void clan::WorkQueue::work_completed | ( | const std::function< void()> & | func | ) |
Queue some work to be executed on the main WorkQueue thread.
std::shared_ptr<T> clan::UserData< T >::data |
Referenced by clan::UserDataOwner::get_data().
std::string clan::Exception::message |
Description of exception.
const float clan::PI = 3.14159274101257f |
const double clan::PI_D = 3.141592653589793115998 |
const float clan::PI_F = 3.14159274101257f |
|
friend |
|
friend |