libloki-0.1.7.orig/ 0000755 0001750 0001750 00000000000 11140365376 012565 5 ustar ivan ivan libloki-0.1.7.orig/doc/ 0000755 0001750 0001750 00000000000 11140366263 013326 5 ustar ivan ivan libloki-0.1.7.orig/doc/flex/ 0000755 0001750 0001750 00000000000 11140365041 014255 5 ustar ivan ivan libloki-0.1.7.orig/doc/flex/flex_string.html 0000644 0001750 0001750 00000003502 10515241547 017500 0 ustar ivan ivan
flex_string
This code accompanies the article
"Type-Safe Formatting" in C/C++ Users Journal, July 2005.
It implements a simple printf emulation framework,
which is typesafe at the price of a slightly modified invocation syntax.
flex_string is a drop-in replacement for the standard string
(std::basic_string, better known by its typedefed name,
std::string.
If you think that reimplementing a likely fine-tuned component of your
standard library is not a very rewarding endeavor, think again.
flex_string
has a policy-based design allowing unparalleled control over its
behavior and optimizations, and also allows you to define new
implementations in only a few dozens of lines of code. If you're
looking for controllable performance and predictible behavior with
multiple threads, then flex_string might be of interest to you.
The downloadable code consists of the flex_string header and
a test suite that compares its behavior against std::string.
Though no performance comparison suite is available at this time,
Harmut Kaizer reported that simply dropping in flex_string
in the Wave Boost Preprocessor improved its speed by 5-10%,
depending on input.
Justin Matthews contributed with
flex_string_hash.h,
an add-on for flex_string
that allows using it with hash maps. Justin's code supports (and
automatically recognizes) two implementations: STLPort and Microsoft
Visual C++ 7.1.
libloki-0.1.7.orig/doc/html/ 0000755 0001750 0001750 00000000000 11140366263 014272 5 ustar ivan ivan libloki-0.1.7.orig/doc/html/a00121.html 0000755 0001750 0001750 00000005162 11140366261 015771 0 ustar ivan ivan
Loki: Loki::SingleThreaded< Host, MutexPolicy >::SingleThreaded::Lock Struct Reference
Dummy Lock class The documentation for this struct was generated from the following file:
Threads.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00309.html 0000755 0001750 0001750 00000004057 11140366256 016007 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00063.html 0000755 0001750 0001750 00000017355 11140366261 016005 0 ustar ivan ivan
Loki: Loki::FunctionStorage< T > Class Template Reference
Unfortunately, the functor argument is not a reference to the SmartPtr but a void *. Making functor argument a reference to the pointer would require the FunctionStorage template to know the full definition of the SmartPtr.
Convenience template to implement a getter function for a singleton object. Often needed in a shared library which hosts singletons.
Usage
see test/SingletonDll The documentation for this class was generated from the following file:
Singleton.h
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00437.html 0000755 0001750 0001750 00000004203 11140366261 015776 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/classes.html 0000755 0001750 0001750 00000060472 11140366255 016632 0 ustar ivan ivan
Loki: Alphabetical List
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00064.html 0000755 0001750 0001750 00000007315 11140366256 016005 0 ustar ivan ivan
Loki: Loki::Functor< R, TList, ThreadingModel > Class Template Reference
template<typename R = void, class TList = NullType, template< class, class > class ThreadingModel = ::Loki::SingleThreaded>
class Loki::Functor< R, TList, ThreadingModel >
A generalized functor implementation with value semantics
Macro: LOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
Define
LOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
to avoid static instantiation/delete order problems. It often helps against crashes when using static Functors and multi threading. Defining also removes problems when unloading Dlls which hosts static Functor objects.
Macro: LOKI_FUNCTORS_ARE_COMPARABLE
To enable the operator== define the macro
LOKI_FUNCTORS_ARE_COMPARABLE
The macro is disabled by default, because it breaks compiling functor objects which have no operator== implemented, keep in mind when you enable operator==.
The documentation for this class was generated from the following file:
Functor.h
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/functions_type.html 0000755 0001750 0001750 00000012361 11140366255 020240 0 ustar ivan ivan
Loki: Class Members - Typedefs
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00379.html 0000755 0001750 0001750 00000004373 11140366260 016012 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00123.html 0000755 0001750 0001750 00000006213 11140366262 015772 0 ustar ivan ivan
Loki: Loki::LongevityLifetime::SingletonFixedLongevity< Longevity, T > Struct Template Reference
The documentation for this struct was generated from the following file:
Singleton.h
Generated on Thu Jan 29 18:51:46 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00192.html 0000755 0001750 0001750 00000157650 11140366256 016017 0 ustar ivan ivan
Loki: Loki Namespace Reference
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP1, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP1, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename T , template< class > class OP, class CP , template< class > class KP, template< class > class SP, template< class > class CNP, typename U >
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
template<typename U , typename T , bool S, class OP , class CP , template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
This file is intented to be used if you want a CachedFactory with a SmartPointer encapsulation policy. It as been defined in a separate file because of the many introduced dependencies (SmartPtr.h would depend on Functor.h and CachedFactory.h would depend on SmartPtr.h). By defining another header you pay for those extra dependencies only if you need it.
Returns count of how mutexes the current thread locked. The lock count exceeds the number of mutexes locked by current thread if any mutex got locked more than once. Requires O(m) actions where m is the number of mutexes in the thread. Never throws exceptions.
Returns count of mutexes locked by current thread which have the same level as GetCurrentThreadsLevel. Requires O(m) actions where m is the number of mutexes in the thread at current level. Never throws exceptions.
Returns level of most recently locked mutex by this thread, or UnlockedLevel if no mutexes are locked. Runs in constant time, and never throws exceptions.
template<template< class, class > class T, std::size_t C, std::size_t M, std::size_t O, template< class > class L, class X >
unsigned int Loki::GetLongevity
(
AllocatorSingleton< T, C, M, O, L, X > *
)
[inline]
This standalone function provides the longevity level for Small-Object Allocators which use the Loki::SingletonWithLongevity policy. The SingletonWithLongevity class can find this function through argument- dependent lookup.
Longevity Levels
No Small-Object Allocator depends on any other Small-Object allocator, so this does not need to calculate dependency levels among allocators, and it returns just a constant. All allocators must live longer than the objects which use the allocators, it must return a longevity level higher than any such object.
template<typename Type >
bool Loki::operator!=
(
const LokiAllocator< Type > &
,
const LokiAllocator< Type > &
)
[inline]
All inequality operators return false since LokiAllocator is basically a monostate design pattern, so all instances of it are identical.
template<typename Type >
bool Loki::operator==
(
const LokiAllocator< Type > &
,
const LokiAllocator< Type > &
)
[inline]
All equality operators return true since LokiAllocator is basically a monostate design pattern, so all instances of it are identical.
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00002_033978d127f16d2da0fd79d31ee75713_cgraph.dot 0000755 0001750 0001750 00000003610 11140366261 023437 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::AllocatorSingleton::IsCorrupted",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::AllocatorSingleton::Instance",height=0.2,width=0.4,color="black",URL="$a00002.html#0de7839b1e888e11ff44bc50b78ca7d7",tooltip="Returns reference to the singleton."];
Node2 -> Node3 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node3 [label="Loki::SingletonHolder::Instance",height=0.2,width=0.4,color="black",URL="$a00124.html#43e4ea5cb6291a8bb14eb7cdc2bcb7bf",tooltip="Returns a reference to singleton object."];
Node1 -> Node4 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node4 [label="Loki::SmallObjAllocator::IsCorrupt",height=0.2,width=0.4,color="black",URL="$a00127.html#2b7fbd5bf5fc56e45754abd2497ad18f"];
Node4 -> Node5 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node5 [label="Loki::SmallObjAllocator::GetAlignment",height=0.2,width=0.4,color="black",URL="$a00127.html#b1c8a2a3d7e9368ab59422ddd082105c",tooltip="Returns # of bytes between allocation boundaries."];
Node4 -> Node6 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node6 [label="Loki::SmallObjAllocator::GetMaxObjectSize",height=0.2,width=0.4,color="black",URL="$a00127.html#e49e9de3fd7b2fd93676cc1d63299b0d",tooltip="Returns max # of bytes which this can allocate."];
Node4 -> Node7 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node7 [label="Loki::GetOffset",height=0.2,width=0.4,color="black",URL="$a00217.html#g2f0821e243f812a3ae2abfaea51895e8"];
}
libloki-0.1.7.orig/doc/html/a00002_033978d127f16d2da0fd79d31ee75713_cgraph.md5 0000755 0001750 0001750 00000000040 11140366261 023330 0 ustar ivan ivan f8dfb5c3e1c321f2e3c1ad90c8d1b952 libloki-0.1.7.orig/doc/html/a00071_b917108c3e7c83b8a515d28e91a3a3ca_cgraph.dot 0000755 0001750 0001750 00000001433 11140366256 023576 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::LevelMutexInfo::IsRecentLock",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::LevelMutexInfo::IsValid",height=0.2,width=0.4,color="black",URL="$a00071.html#36c34ecf5d019f3db9bfb8654cf49176"];
Node2 -> Node3 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node3 [label="Loki::LevelMutexInfo::IsValidList",height=0.2,width=0.4,color="black",URL="$a00071.html#01f6dfba5d2ea5606109b34e5a543cf0"];
}
libloki-0.1.7.orig/doc/html/a00071_b917108c3e7c83b8a515d28e91a3a3ca_cgraph.md5 0000755 0001750 0001750 00000000040 11140366256 023466 0 ustar ivan ivan 1ec952100fbd9036268f9242d2fd56a0 libloki-0.1.7.orig/doc/html/a00192_ae4c5edaad45b3657f39e8cdbae0f928_cgraph.dot 0000755 0001750 0001750 00000002602 11140366255 024175 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::CountLocksInCurrentThread",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::LevelMutexInfo::GetCurrentMutex",height=0.2,width=0.4,color="black",URL="$a00071.html#b7fd94847721b118979b72121472d3e2"];
Node2 -> Node3 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node3 [label="Loki::LevelMutexInfo::IsValidList",height=0.2,width=0.4,color="black",URL="$a00071.html#01f6dfba5d2ea5606109b34e5a543cf0"];
Node1 -> Node4 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node4 [label="Loki::LevelMutexInfo::GetLockCount",height=0.2,width=0.4,color="black",URL="$a00071.html#013e7ffd438e4c1f11dcc6943a40802e",tooltip="Returns count of how many times this mutex got locked."];
Node1 -> Node5 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node5 [label="Loki::LevelMutexInfo::GetPrevious",height=0.2,width=0.4,color="black",URL="$a00071.html#b774e94ff72724dd87ff236d99970bb5",tooltip="Returns pointer to mutex previously locked by the thread which locked this."];
}
libloki-0.1.7.orig/doc/html/a00192_ae4c5edaad45b3657f39e8cdbae0f928_cgraph.md5 0000755 0001750 0001750 00000000040 11140366255 024066 0 ustar ivan ivan ab1db9ef206e6585d1694a0cf35f7574 libloki-0.1.7.orig/doc/html/a00310.html 0000755 0001750 0001750 00000004025 11140366256 015772 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00065.html 0000755 0001750 0001750 00000011245 11140366261 015777 0 ustar ivan ivan
Loki: Loki::HeapStorage< T > Class Template Reference
Implementation of the StoragePolicy used by SmartPtr. Uses explicit call to T's destructor followed by call to free. The documentation for this class was generated from the following file:
SmartPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00218_g7c1d35d961854e812b743b22c89f14f8_cgraph.dot 0000755 0001750 0001750 00000001163 11140366254 023552 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::operator!=",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::StrongPtr::Equals",height=0.2,width=0.4,color="black",URL="$a00135.html#0c197e9b4f68669529435577357ffa57",tooltip="Helper function which can be called to avoid exposing GetPointer function."];
}
libloki-0.1.7.orig/doc/html/a00218_g7c1d35d961854e812b743b22c89f14f8_cgraph.md5 0000755 0001750 0001750 00000000040 11140366254 023442 0 ustar ivan ivan 31451293eec8b49974aef0bdb7cfdbde libloki-0.1.7.orig/doc/html/a00124.html 0000755 0001750 0001750 00000011406 11140366260 015771 0 ustar ivan ivan
Loki: Loki::SingletonHolder< T, CreationPolicy, LifetimePolicy, ThreadingModel, MutexPolicy > Class Template Reference
template<typename T, template< class > class CreationPolicy = CreateUsingNew, template< class > class LifetimePolicy = DefaultLifetime, template< class, class > class ThreadingModel = ::Loki::SingleThreaded, class MutexPolicy = ::Loki::Mutex>
class Loki::SingletonHolder< T, CreationPolicy, LifetimePolicy, ThreadingModel, MutexPolicy >
Provides Singleton amenities for a type T To protect that type from spurious instantiations, you have to protect it yourself.
The documentation for this class was generated from the following file:
Singleton.h
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00439.html 0000755 0001750 0001750 00000004200 11140366261 015775 0 ustar ivan ivan
Loki: Member List
Convenience template for the implementations which Pimpl points to. The documentation for this class was generated from the following file:
Pimpl.h
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00380.html 0000755 0001750 0001750 00000003665 11140366260 016005 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::CreateUsingNew< T >, including all inherited members.
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00125.html 0000755 0001750 0001750 00000005407 11140366260 015776 0 ustar ivan ivan
Loki: Loki::SingletonWithLongevity< T > Struct Template Reference
template<class T>
struct Loki::SingletonWithLongevity< T >
Implementation of the LifetimePolicy used by SingletonHolder Schedules an object's destruction in order of their longevities Assumes a visible function GetLongevity(T*) that returns the longevity of the object. The documentation for this struct was generated from the following file:
Singleton.h
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00312.html 0000755 0001750 0001750 00000003725 11140366256 016002 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00067.html 0000755 0001750 0001750 00000005054 11140366256 016006 0 ustar ivan ivan
Loki: Loki::JustReturnMutexError Class Reference
Implements the ErrorPolicy for LevelMutex and does nothing no matter how bad the error condition. Only recommended use is for automated unit-testing of mutex policies. The documentation for this class was generated from the following file:
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00381.html 0000755 0001750 0001750 00000003673 11140366260 016005 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00126.html 0000755 0001750 0001750 00000015101 11140366257 015775 0 ustar ivan ivan
Loki: Loki::SleepLevelMutex Class Reference
Implements a sleeping loop to wait for the mutex to unlock.
Purpose
Since this class puts the thread to sleep for short intervals, you can use this class for most of your mutexes. Especially for locking any high level resources where any one operation on the resouce consumes many CPU cycles. The purpose of this mutex is to reduce the number of CPU cycles spent in idle loops. All SleepLevelMutex's should have higher levels than all your SpinLevelMutex's.
Dependence on SpinLevelMutex
This utilizes SpinLevelMutex so it does not have to re-implement the DoTryLock and DoUnlock functions the same way. All it really needs is a DoLock function and the amount of time it should sleep if an attempt to lock a function fails.
Constructor & Destructor Documentation
Loki::SleepLevelMutex::SleepLevelMutex
(
unsigned int
level
)
[explicit]
Constructs a levelized mutex that puts threads to sleep while they wait for another thread to unlock the mutex.
Parameters:
level
Level of this mutex.
Member Function Documentation
MutexErrors::Type Loki::SleepLevelMutex::Lock
(
void
)
volatile [virtual]
Attempts to lock a mutex, and if it fails, then sleeps for a while before attempting again.
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00440.html 0000755 0001750 0001750 00000014776 11140366261 016010 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00068.html 0000755 0001750 0001750 00000004744 11140366256 016014 0 ustar ivan ivan
Loki: Loki::Key< Factory, IdentifierType > Class Template Reference
template<class Factory, typename IdentifierType>
class Loki::Key< Factory, IdentifierType >
A Key class The documentation for this class was generated from the following file:
Key.h
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00382.html 0000755 0001750 0001750 00000003661 11140366260 016003 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::CreateStatic< T >, including all inherited members.
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00127.html 0000755 0001750 0001750 00000045005 11140366261 015777 0 ustar ivan ivan
Loki: Loki::SmallObjAllocator Class Reference
Manages pool of fixed-size allocators. Designed to be a non-templated base class of AllocatorSingleton so that implementation details can be safely hidden in the source code file.
Constructor & Destructor Documentation
Loki::SmallObjAllocator::SmallObjAllocator
(
std::size_t
pageSize,
std::size_t
maxObjectSize,
std::size_t
objectAlignSize
)
[protected]
The only available constructor needs certain parameters in order to initialize all the FixedAllocator's. This throws only if
Destructor releases all blocks, all Chunks, and FixedAllocator's. Any outstanding blocks are unavailable, and should not be used after this destructor is called. The destructor is deliberately non-virtual because it is protected, not public.
Member Function Documentation
void * Loki::SmallObjAllocator::Allocate
(
std::size_t
size,
bool
doThrow
)
Allocates a block of memory of requested size. Complexity is often constant-time, but might be O(C) where C is the number of Chunks in a FixedAllocator.
Exception Safety Level
Provides either strong-exception safety, or no-throw exception-safety level depending upon doThrow parameter. The reason it provides two levels of exception safety is because it is used by both the nothrow and throwing new operators. The underlying implementation will never throw of its own accord, but this can decide to throw if it does not allocate. The only exception it should emit is std::bad_alloc.
Allocation Failure
If it does not allocate, it will call TrimExcessMemory and attempt to allocate again, before it decides to throw or return NULL. Many allocators loop through several new_handler functions, and terminate if they can not allocate, but not this one. It only makes one attempt using its own implementation of the new_handler, and then returns NULL or throws so that the program can decide what to do at a higher level. (Side note: Even though the C++ Standard allows allocators and new_handlers to terminate if they fail, the Loki allocator does not do that since that policy is not polite to a host program.)
Parameters:
size
# of bytes needed for allocation.
doThrow
True if this should throw if unable to allocate, false if it should provide no-throw exception safety level.
Returns:
NULL if nothing allocated and doThrow is false. Else the pointer to an available block of memory.
Deallocates a block of memory at a given place but of unknown size size. Complexity is O(F + C) where F is the count of FixedAllocator's in the pool, and C is the number of Chunks in all FixedAllocator's. This does not throw exceptions. This overloaded version of Deallocate is called by the nothow delete operator - which is called when the nothrow new operator is used, but a constructor throws an exception.
Deallocates a block of memory at a given place and of a specific size. Complexity is almost always constant-time, and is O(C) only if it has to search for which Chunk deallocates. This never throws.
Returns true if anything in implementation is corrupt. Complexity is O(F + C + B) where F is the count of FixedAllocator's in the pool, C is the number of Chunks in all FixedAllocator's, and B is the number of blocks in all Chunks. If it determines any data is corrupted, this will return true in release version, but assert in debug version at the line where it detects the corrupted data. If it does not detect any corrupted data, it returns false.
Releases empty Chunks from memory. Complexity is O(F + C) where F is the count of FixedAllocator's in the pool, and C is the number of Chunks in all FixedAllocator's. This will never throw. This is called by AllocatorSingleto::ClearExtraMemory, the new_handler function for Loki's allocator, and is called internally when an allocation fails.
Returns:
True if any memory released, or false if none released.
The documentation for this class was generated from the following files:
SmallObj.h
SmallObj.cpp
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/graph_legend.html 0000755 0001750 0001750 00000011377 11140366263 017613 0 ustar ivan ivan
Loki: Graph Legend
This page explains how to interpret the graphs that are generated by doxygen.
Consider the following example:
/*! Invisible class because of truncation */class Invisible { };
/*! Truncated class, inheritance relation is hidden */class Truncated : public Invisible { };
/* Class not documented with doxygen comments */class Undocumented { };
/*! Class that is inherited using public inheritance */class PublicBase : public Truncated { };
/*! A template class */template<class T> class Templ { };
/*! Class that is inherited using protected inheritance */class ProtectedBase { };
/*! Class that is inherited using private inheritance */class PrivateBase { };
/*! Class that is used by the Inherited class */class Used { };
/*! Super class that inherits a number of other classes */class Inherited : public PublicBase,
protected ProtectedBase,
private PrivateBase,
public Undocumented,
public Templ<int>
{
private:
Used *m_usedClass;
};
This will result in the following graph:
The boxes in the above graph have the following meaning:
A filled gray box represents the struct or class for which the graph is generated.
A box with a black border denotes a documented struct or class.
A box with a grey border denotes an undocumented struct or class.
A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
A dark blue arrow is used to visualize a public inheritance relation between two classes.
A dark green arrow is used for protected inheritance.
A dark red arrow is used for private inheritance.
A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.
Generated on Thu Jan 29 18:51:47 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00441.html 0000755 0001750 0001750 00000003615 11140366261 015777 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::Mutex, including all inherited members.
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00196.html 0000755 0001750 0001750 00000004104 11140366262 016001 0 ustar ivan ivan
Loki: LongevityLifetime Namespace Reference
In this namespace are special lifetime policies to manage lifetime dependencies.
More...
Detailed Description
In this namespace are special lifetime policies to manage lifetime dependencies.
Generated on Thu Jan 29 18:51:46 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00314.html 0000755 0001750 0001750 00000003671 11140366256 016004 0 ustar ivan ivan
Loki: Member List
template<typename T, bool S, class OP, class CP, template< class > class KP, template< class > class RP, template< class > class DP, template< class > class CNP>
struct std::less< Loki::StrongPtr< T, S, OP, CP, KP, RP, DP, CNP > >
specialization of std::less for StrongPtr The documentation for this struct was generated from the following file:
StrongPtr.h
Generated on Thu Jan 29 18:51:46 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00383.html 0000755 0001750 0001750 00000003667 11140366260 016012 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00128.html 0000755 0001750 0001750 00000010051 11140366261 015771 0 ustar ivan ivan
Loki: Loki::SmallObject< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > Class Template Reference
template<template< class, class > class ThreadingModel = ::Loki::SingleThreaded, std::size_t chunkSize = 4096, std::size_t maxSmallObjectSize = 256, std::size_t objectAlignSize = 4, template< class > class LifetimePolicy = ::Loki::LongevityLifetime::DieAsSmallObjectParent, class MutexPolicy = ::Loki::Mutex>
class Loki::SmallObject< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >
SmallObject Base class for polymorphic small objects, offers fast allocations & deallocations. Destructor is virtual and public. Default constructor is trivial. Copy-constructor and copy-assignment operator are not implemented since polymorphic classes almost always disable those operations. Class has no data members so compilers can use Empty-Base-Optimization. The documentation for this class was generated from the following file:
SmallObj.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00442.html 0000755 0001750 0001750 00000003725 11140366261 016002 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00197.html 0000755 0001750 0001750 00000004247 11140366262 016012 0 ustar ivan ivan
Loki: std Namespace Reference
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00384.html 0000755 0001750 0001750 00000003671 11140366260 016006 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00129.html 0000755 0001750 0001750 00000036036 11140366261 016005 0 ustar ivan ivan
Loki: Loki::SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > Class Template Reference
Placement single-object delete merely calls global placement delete.
Detailed Description
template<template< class, class > class ThreadingModel, std::size_t chunkSize, std::size_t maxSmallObjectSize, std::size_t objectAlignSize, template< class > class LifetimePolicy, class MutexPolicy>
class Loki::SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >
Base class for small object allocation classes. The shared implementation of the new and delete operators are here instead of being duplicated in both SmallObject or SmallValueObject, later just called Small-Objects. This class is not meant to be used directly by clients, or derived from by clients. Class has no data members so compilers can use Empty-Base-Optimization.
ThreadingModel
This class doesn't support ObjectLevelLockable policy for ThreadingModel. The allocator is a singleton, so a per-instance mutex is not necessary. Nor is using ObjectLevelLockable recommended with SingletonHolder since the SingletonHolder::MakeInstance function requires a mutex that exists prior to when the object is created - which is not possible if the mutex is inside the object, such as required for ObjectLevelLockable. If you attempt to use ObjectLevelLockable, the compiler will emit errors because it can't use the default constructor in ObjectLevelLockable. If you need a thread-safe allocator, use the ClassLevelLockable policy.
Lifetime Policy
The SmallObjectBase template needs a lifetime policy because it owns a singleton of SmallObjAllocator which does all the low level functions. When using a Small-Object in combination with the SingletonHolder template you have to choose two lifetimes, that of the Small-Object and that of the singleton. The rule is: The Small-Object lifetime must be greater than the lifetime of the singleton hosting the Small-Object. Violating this rule results in a crash on exit, because the hosting singleton tries to delete the Small-Object which is then already destroyed.
The lifetime policies recommended for use with Small-Objects hosted by a SingletonHolder template are
The DefaultLifetime and PhoenixSingleton policies are *not* recommended since they can cause the allocator to be destroyed and release memory for singletons hosting a object which inherit from either SmallObject or SmallValueObject.
Both Small-Object and Singleton use SingletonWithLongevity policy. The longevity level for the singleton must be lower than that for the Small-Object. This is why the AllocatorSingleton's GetLongevity function returns the highest value.
FollowIntoDeath lifetime: The Small-Object has FollowIntoDeath::With<LIFETIME>::AsMasterLiftime policy and the Singleton has FollowIntoDeath::AfterMaster<MASTERSINGLETON>::IsDestroyed policy, where you could choose the LIFETIME.
Both Small-Object and Singleton use NoDestroy policy. Since neither is ever destroyed, the destruction order does not matter. Note: you will get memory leaks!
template<template< class, class > class ThreadingModel, std::size_t chunkSize, std::size_t maxSmallObjectSize, std::size_t objectAlignSize, template< class > class LifetimePolicy, class MutexPolicy>
Defines type of allocator singleton, must be public to handle singleton lifetime dependencies.
Member Function Documentation
template<template< class, class > class ThreadingModel, std::size_t chunkSize, std::size_t maxSmallObjectSize, std::size_t objectAlignSize, template< class > class LifetimePolicy, class MutexPolicy>
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00198.html 0000755 0001750 0001750 00000005450 11140366254 016011 0 ustar ivan ivan
Loki: Factories
Generated on Thu Jan 29 18:51:40 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00001.html 0000755 0001750 0001750 00000004454 11140366255 015774 0 ustar ivan ivan
Loki: AbstractFactory Class Reference
Implements an abstract object factory. The documentation for this class was generated from the following file:
AbstractFactory.h
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00070.html 0000755 0001750 0001750 00000054154 11140366257 016006 0 ustar ivan ivan
Loki: Loki::LevelMutex< MutexPolicy, DefaultLevel, ErrorPolicy, WaitPolicy > Class Template Reference
template<class MutexPolicy, unsigned int DefaultLevel, class ErrorPolicy = ::Loki::ThrowOnBadDesignMutexError, class WaitPolicy = ::Loki::NoMutexWait>
class Loki::LevelMutex< MutexPolicy, DefaultLevel, ErrorPolicy, WaitPolicy >
Levelized mutex class prevents deadlocks by requiring programs to lock mutexes in the same order, and unlock them in reverse order. This is accomplished by forcing each mutex to have a level and forcing code to lock mutexes with higher levels before locking mutexes at lower levels. If you want to lock several mutexes, they must be locked in decreasing order by level, or if they are all of the same level, then locked by LevelMutex::MultiLock.
Features
Immune: Very unlikely to deadlock since all mutexes are locked in the same order and unlocked in reverse order.
Scalable: Can handle any number of mutexes.
Efficient: Many operations occur in constant time, and most operations require no more than O(m) steps.
Exception safe: All operations provide strong safety or don't throw.
Extendable: Can work with existing mutexes through policy-based design.
Easily Extended: Derived classes only need to implement 5 functions and a mutex to get all the features of this class.
Re-Entrant: Allows for re-entrancy even if mutexes in policy classes don't.
Cost-Free: No resource allocations occur in LevelMutex - although user-defined policy classes may allocate resources.
Portable: As long as your compiler and libraries can meet the requirements.
Robust: Maintains data integrity even if exceptions occur in policy classes.
Affording: Several functions provide information about a mutex which allows client code to easily choose correct actions.
Requirements
Your compiler must allow for thread-specific data.
You must have a threading or mutex library.
Policy-Based Design
This class hosts 3 policies and a default level. The policy-based design allows users to write their own policies to extend the behaviors of LevelMutex. The paragraphs below say how to design a class for each policy.
MutexPolicy The mutex policy class.
defaultLevel A level for existing client code that calls a default constructor.
ErrorPolicy How the mutex should handle error conditions.
WaitPolicy Whether a thread should wait, and how long in some internal loops.
MutexPolicy
A policy class that wraps a low-level mutex. Loki provides two policy classes for the actual mutex (SpinLevelMutex and SleepLevelMutex), both of which wrap either pthreads or the Windows CRITICAL_SECTION. If you want to use a mutex mechanism besides one of those, then all you have to do is provide a class which wraps the mutex and implements these functions. explicit SpinLevelMutex( unsigned int level ); virtual ~SpinLevelMutex( void ); virtual MutexErrors::Type Lock( void ) volatile; virtual MutexErrors::Type TryLock( void ) volatile; virtual MutexErrors::Type Unlock( void ) volatile; Indeed, since the base class does most of the work, and provides all the interace and functionality to client classes, a derived class has very few requirements. It only needs to implement a single constructor, the destructor, some virtual functions, and whatever data members it requires. You don't actually need to declare those functions as virtual if the policy class is not a base or child class. In the parlance of design patterns, LevelMutex is a Template, and the MutexPolicy is a Strategy.
DefaultLevel
The template class requires a default level to use inside the default constructor. Some existing code calls instantiates mutexes with a default constructor, so the mutex must know what level to use there. Please do not use zero or UnlockedLevel as the default level.
ErrorPolicy
This policy specifies how to handle error conditions. The mutexes can return errors, assert, or throw exceptions. I recommend that debug code use asserts, release code use exceptions, and unit-testing code just return errors. The error policy class only needs to implement one function: static MutexErrors::Type CheckError( MutexErrors::Type error, unsigned int level );
WaitPolicy
This states whether the mutex should wait within some tight internal loops, how the waiting is done, and for how long. A wait policy class could sleep, do nothing, check if other objects need attention, or check if the program received events or notices from the operating system. It only needs to implement one function: static void Wait( void );
Per-Function Usage
If you implement a function with a static local mutex, then you have to insure the function is not called from a lower level via call-backs, virtual functions in interface classes. If the function does get called from a lower level, you are setting up a potential deadlock. LevelMutex will detect that by checking the current level and the local mutex's level, so it will refuse to lock the local mutex.
Per-Object Usage
If you use a mutex as a data member of an object to protect that object, then I recommend specifying which functions are volatile and which are not, and then only use the mutex within the volatile functions. You may also want to provide accessor functions so that client code can lock and unlock the mutex either to allow for calling multiple operations without having to lock and unlock before and after each operation, or so they can lock it along with several other objects at the same level.
Per-Class Usage
If you make a static data member within a class, you can use that to lock any resources shared by those objects, or to require threads to act on only one object at a time. You may also want to provide static accessor functions so that client code can lock several other resources at the same level.
Constructor & Destructor Documentation
template<class MutexPolicy , unsigned int DefaultLevel, class ErrorPolicy = ::Loki::ThrowOnBadDesignMutexError, class WaitPolicy = ::Loki::NoMutexWait>
This constructor allows callers to replace the default level with another value. It also acts as the default constructor for existing code which uses default construction for mutexes. This is the only time the DefaultLevel template parameter gets used.
template<class MutexPolicy , unsigned int DefaultLevel, class ErrorPolicy = ::Loki::ThrowOnBadDesignMutexError, class WaitPolicy = ::Loki::NoMutexWait>
These functions allow callers to access the mutex in case they need to modify specific values in the MutexPolicy (e.g. - sleep time, functors to call as tasks, etc...) There is one function for every combination of const and volatile qualifiers so callers get a reference to a MutexPolicy with the proper qualifiers.
template<class MutexPolicy , unsigned int DefaultLevel, class ErrorPolicy = ::Loki::ThrowOnBadDesignMutexError, class WaitPolicy = ::Loki::NoMutexWait>
Attempts to lock mutex, but only waits for a limited amount of time before it gives up. Will return quickly if an error occurs before any attempt to lock. This may throw an exception if the lock failed or an error occurred - if that is what the error policy specifies.
template<class MutexPolicy , unsigned int DefaultLevel, class ErrorPolicy = ::Loki::ThrowOnBadDesignMutexError, class WaitPolicy = ::Loki::NoMutexWait>
Blocking call will attempt to lock mutex and wait until it can lock. This may throw an exception if the lock failed or an error occurred - if that is what the error policy specifies.
template<class MutexPolicy , unsigned int DefaultLevel, class ErrorPolicy = ::Loki::ThrowOnBadDesignMutexError, class WaitPolicy = ::Loki::NoMutexWait>
Tries to lock mutex, and returns immediately if mutex already locked by another thread. It will return immediately with a value of AlreadyLocked if the mutex was locked by a different thread. It may throw an exception or assert when errors occur if the ErrorPolicy class implements that behavior.
template<class MutexPolicy , unsigned int DefaultLevel, class ErrorPolicy = ::Loki::ThrowOnBadDesignMutexError, class WaitPolicy = ::Loki::NoMutexWait>
Unlocks the mutex, or returns an error condition. This may throw an exception if the lock failed or an error occurred - if that is what the error policy specifies.
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00200.dot 0000755 0001750 0001750 00000002656 11140366254 015620 0 ustar ivan ivan digraph structs
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node0 [label="Cached Factory",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node4 [label="Eviction policies",height=0.2,width=0.4,color="black",URL="$a00203.html",tooltip="Gathers informations about the stored objects and choose a candidate for eviction..."];
Node2 [label="Encapsulation policies",height=0.2,width=0.4,color="black",URL="$a00201.html",tooltip="Defines how the object is returned to the client."];
Node1 [label="Factories",height=0.2,width=0.4,color="black",URL="$a00198.html"];
Node5 [label="Statistic policies",height=0.2,width=0.4,color="black",URL="$a00204.html",tooltip="Gathers information about the cache."];
Node3 [label="Creation policies",height=0.2,width=0.4,color="black",URL="$a00202.html",tooltip="Defines a way to limit the creation operation."];
Node1->Node0 [shape=plaintext, color="midnightblue", dir="back", style="solid"];
Node0->Node2 [shape=plaintext, color="midnightblue", dir="back", style="solid"];
Node0->Node3 [shape=plaintext, color="midnightblue", dir="back", style="solid"];
Node0->Node4 [shape=plaintext, color="midnightblue", dir="back", style="solid"];
Node0->Node5 [shape=plaintext, color="midnightblue", dir="back", style="solid"];
}
libloki-0.1.7.orig/doc/html/a00201.dot 0000755 0001750 0001750 00000001113 11140366254 015604 0 ustar ivan ivan digraph structs
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Cached Factory",height=0.2,width=0.4,color="black",URL="$a00200.html",tooltip="CachedFactory provides an extension of a Factory with caching support."];
Node0 [label="Encapsulation policies",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1->Node0 [shape=plaintext, color="midnightblue", dir="back", style="solid"];
}
libloki-0.1.7.orig/doc/html/a00385.html 0000755 0001750 0001750 00000004260 11140366260 016002 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::BaseVisitor, including all inherited members.
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00199.html 0000755 0001750 0001750 00000004312 11140366254 016006 0 ustar ivan ivan
Loki: Abstract Factory
template<template< class, class > class ThreadingModel = ::Loki::SingleThreaded, std::size_t chunkSize = 4096, std::size_t maxSmallObjectSize = 256, std::size_t objectAlignSize = 4, template< class > class LifetimePolicy = ::Loki::LongevityLifetime::DieAsSmallObjectParent, class MutexPolicy = ::Loki::Mutex>
class Loki::AllocatorSingleton< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >
This template class is derived from SmallObjAllocator in order to pass template arguments into it, and still have a default constructor for the singleton. Each instance is a unique combination of all the template parameters, and hence is singleton only with respect to those parameters. The template parameters have default values and the class has typedefs identical to both SmallObject and SmallValueObject so that this class can be used directly instead of going through SmallObject or SmallValueObject. That design feature allows clients to use the new_handler without having the name of the new_handler function show up in classes derived from SmallObject or SmallValueObject. Thus, the only functions in the allocator which show up in SmallObject or SmallValueObject inheritance hierarchies are the new and delete operators.
Member Function Documentation
template<template< class, class > class T, std::size_t C, std::size_t M, std::size_t O, template< class > class L, class X >
Clears any excess memory used by the allocator. Complexity is O(F + C) where F is the count of FixedAllocator's in the pool, and C is the number of Chunks in all FixedAllocator's. This never throws.
Note:
This function can be used as a new_handler when Loki and other memory allocators can no longer allocate. Although the C++ Standard allows new_handler functions to terminate the program when they can not release any memory, this will not do so.
Returns true if anything in implementation is corrupt. Complexity is O(F + C + B) where F is the count of FixedAllocator's in the pool, C is the number of Chunks in all FixedAllocator's, and B is the number of blocks in all Chunks. If it determines any data is corrupted, this will return true in release version, but assert in debug version at the line where it detects the corrupted data. If it does not detect any corrupted data, it returns false.
This monolithic base class stores common info for a template class used to control mutexes. The template class, LevelMutex, is policy-based class.
Implementation
Each thread has a list of mutexes it locked. When a mutex first gets locked, it gets added to the head of the list. If locked again, LevelMutex merely increments a count. When unlocked, the count gets decremented until it reaches zero, and then it gets removed from the list. Each mutex has a pointer to the mutex most recently locked by the current thread. The current level of a thread is always the level of the most recently locked mutex, or UnlockedLevel if the thread does not have any mutexes locked now. A mutex is considered "recently" locked if it is at the head of the list, or the same level as the current mutex and also locked by the current thread.
Class Invariants
This class maintains invariants for each LevelMutexInfo so that no function calls corrupt a mutex. Each function makes a call to IsValid at the start so that LevelMutex knows it acts on valid internal data. Many functions call IsValid again when they return to insure the function did not leave any data in an invalid state. The exit call to IsValid occurs through a tiny helper class called Checker to insure all data remain valid even when exceptions occur. Another helper class, MutexUndoer, unlocks mutexes in a container if an exception occurs during calls to MultiLock.
Error Results
Many functions return an enum value to indicate an error status. Many enum values indicate errors detected within LevelMutex, but some indicate errors found in policy classes, SpinLevelMutex and SleepLevelMutex.
Constructor & Destructor Documentation
Loki::LevelMutexInfo::LevelMutexInfo
(
unsigned int
level
)
[explicit, protected]
This is the only available constructor, and it forces any derived class to set a level for each mutex.
Gives pointer to most recently locked mutex, or NULL if nothing locked. The pointer is for a const mutex so the mutex can't be modified inappropriately. The pointer is for a volatile mutex so callers can call volatile member functions to get info about the mutex.
Returns true if this mutex was locked by current thread, and level is the same as the current thread's level. Which means this was the most recently locked mutex, or it was locked along with several others of the same level recently.
Returns true if linked-list of locked mutexes in this thread is valid. Which means the list has no loops, and each previous mutex on the list has a higher or same level as the current mutex. Called by IsValid.
Attempts to lock mutex, but only waits for a limited amount of time before it gives up. Will return quickly if an error occurs before any attempt to lock. This may throw an exception if the lock failed or an error occurred - if that is what the error policy specifies.
Blocking call will attempt to lock mutex and wait until it can lock. This may throw an exception if the lock failed or an error occurred - if that is what the error policy specifies.
Locks several mutexes at once. Requires O(m + n*n + n*t) actions where m is the number of mutexes currently locked by the thread, n is the number of mutexes in the container, and t is the wait time for each mutex. This provides strong exception safety. If an exception occurs, any mutexes that were locked during this call will ge unlocked.
Parameters:
mutexes
Container of pointers to mutexes. Container must have at least 1 mutex, all mutexes must have the same level, no NULL pointers, and all mutexes must not exceed the thread's current level. This sorts the container by address order.
Locks several mutexes at once. Requires O(m + n*n) actions where m is the number of mutexes currently locked by the thread and n is the number of mutexes in the container. This provides strong exception safety. If an exception occurs, any mutexes that were locked during this call will get unlocked.
Parameters:
mutexes
Container of pointers to mutexes. Container must have at least 1 mutex, all mutexes must have the same level, no NULL pointers, and all mutexes must not exceed the thread's current level. This sorts the container by address order.
Unlocks several mutexes at once. Requires O(m) actions where m is the number of mutexes in the container. This provides strong exception safety. If an exception occurs when unlocking one mutex, other mutexes in the container get unlocked anyway.
Parameters:
mutexes
Container of pointers to mutexes. Container must have at least 1 mutex, all mutexes must have the same level, no NULL pointers, and all mutexes must be locked by the current thread. This sorts the container dby address order.
Tries to lock mutex, and returns immediately if mutex already locked by another thread. It will return immediately with a value of AlreadyLocked if the mutex was locked by a different thread. It may throw an exception or assert when errors occur if the ErrorPolicy class implements that behavior.
Unlocks the mutex, or returns an error condition. This may throw an exception if the lock failed or an error occurred - if that is what the error policy specifies.
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00386.html 0000755 0001750 0001750 00000003705 11140366260 016006 0 ustar ivan ivan
Loki: Member List
template<template< class, class > class ThreadingModel = ::Loki::SingleThreaded, std::size_t chunkSize = 4096, std::size_t maxSmallObjectSize = 256, std::size_t objectAlignSize = 4, template< class > class LifetimePolicy = ::Loki::LongevityLifetime::DieAsSmallObjectParent, class MutexPolicy = ::Loki::Mutex>
class Loki::SmallValueObject< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >
SmallValueObject Base class for small objects with value-type semantics - offers fast allocations & deallocations. Destructor is non-virtual, inline, and protected to prevent unintentional destruction through base class. Default constructor is trivial. Copy-constructor and copy-assignment operator are trivial since value-types almost always need those operations. Class has no data members so compilers can use Empty-Base-Optimization. The documentation for this class was generated from the following file:
Implementation of the ConversionPolicy used by SmartPtr Allows implicit conversion from SmartPtr to the pointee type The documentation for this struct was generated from the following file:
SmartPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00219.dot 0000755 0001750 0001750 00000000766 11140366255 015633 0 ustar ivan ivan digraph structs
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Smart pointers",height=0.2,width=0.4,color="black",URL="$a00218.html"];
Node0 [label="Ownership policies",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1->Node0 [shape=plaintext, color="midnightblue", dir="back", style="solid"];
}
libloki-0.1.7.orig/doc/html/a00318.html 0000755 0001750 0001750 00000017531 11140366256 016010 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00072.html 0000755 0001750 0001750 00000005744 11140366256 016010 0 ustar ivan ivan
Loki: Loki::LevelMutexInfo::LevelMutexInfo::Checker Class Reference
check on mutex to insure no class invariants were violated inside any member function. This class only gets used in debug builds, and any instance of it gets optimized away in release builds. A checker is created inside many of member functions so that it's destructor gets called when the function exits. It determines if any class invariants were violated during the function call. The documentation for this class was generated from the following file:
Generated on Thu Jan 29 18:51:47 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00387.html 0000755 0001750 0001750 00000003653 11140366260 016011 0 ustar ivan ivan
Loki: Member List
template<class AbstractProduct, template< class > class OwnershipPolicy = RefCounted, class ConversionPolicy = DisallowConversion, template< class > class CheckingPolicy = AssertCheck, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
class Loki::SmartPointer< AbstractProduct, OwnershipPolicy, ConversionPolicy, CheckingPolicy, ConstnessPolicy >
The object will come back to the Cache as soon as no more SmartPtr are referencing this object. You can customize the SmartPointer with the standard SmartPtr policies (OwnershipPolicy, ConversionPolicy, CheckingPolicy, ConstnessPolicy) but StoragePolicy is forced to FunctionStorage.
The documentation for this class was generated from the following file:
Implementation of the ResetPolicy used by StrongPtr. It allows reset and release under any circumstance. The documentation for this class was generated from the following file:
StrongPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00073.html 0000755 0001750 0001750 00000005377 11140366256 016013 0 ustar ivan ivan
Loki: Loki::LevelMutexInfo::LevelMutexInfo::MutexUndoer Class Reference
Undoes actions by MultiLock if an exception occurs. It keeps track of which mutexes in a container got locked, and if an exception occurs, then the destructor unlocks them. If MultiLock succeeds, then it cancels the undoer so nothing gets unlocked inadvertently. The documentation for this class was generated from the following files:
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00388.html 0000755 0001750 0001750 00000004151 11140366260 016004 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00132.html 0000755 0001750 0001750 00000010061 11140366261 015765 0 ustar ivan ivan
Loki: Loki::SmartPtr< T, OwnershipPolicy, ConversionPolicy, CheckingPolicy, StoragePolicy, ConstnessPolicy > Class Template Reference
template<typename T, template< class > class OwnershipPolicy, class ConversionPolicy, template< class > class CheckingPolicy, template< class > class StoragePolicy, template< class > class ConstnessPolicy>
class Loki::SmartPtr< T, OwnershipPolicy, ConversionPolicy, CheckingPolicy, StoragePolicy, ConstnessPolicy >
Due to threading issues, the OwnershipPolicy has been changed as follows:
Release() returns a boolean saying if that was the last release so the pointer can be deleted by the StoragePolicy
IsUnique() was removed
The documentation for this class was generated from the following file:
SmartPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00218_gb5a35f4e3da89fb451c36891a96ab244_cgraph.dot 0000755 0001750 0001750 00000001163 11140366254 023760 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::operator==",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::StrongPtr::Equals",height=0.2,width=0.4,color="black",URL="$a00135.html#0c197e9b4f68669529435577357ffa57",tooltip="Helper function which can be called to avoid exposing GetPointer function."];
}
libloki-0.1.7.orig/doc/html/a00218_gb5a35f4e3da89fb451c36891a96ab244_cgraph.md5 0000755 0001750 0001750 00000000040 11140366254 023650 0 ustar ivan ivan ca45b4417f7d100df8fec30598fc6a49 libloki-0.1.7.orig/doc/html/a00447.html 0000755 0001750 0001750 00000003701 11140366261 016001 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00005.html 0000755 0001750 0001750 00000004757 11140366256 016007 0 ustar ivan ivan
Loki: Loki::AlwaysCreate Class Reference
The documentation for this class was generated from the following file:
CachedFactory.h
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00074.html 0000755 0001750 0001750 00000005763 11140366255 016012 0 ustar ivan ivan
Loki: LockableTwoRefCountInfo Class Reference
Implementation detail for thread-safe reference counting for strong and weak pointers. It uses TwoRefCountInfo to manage the pointer and counts. All this does is provide a thread safety mechanism. Since it is just a class for managing implementation details, it is not intended to be used directly - which is why it is in a private namespace. Each instance is a shared resource for all copointers, and there should be only one of these for each set of copointers. This class is small, trivial, and inline.
Note:
This class is not designed for use with a single-threaded model. Tests using a single-threaded model will not run properly, but tests in a multi-threaded model with either class-level-locking or object-level-locking do run properly.
The documentation for this class was generated from the following file:
StrongPtr.h
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00389.html 0000755 0001750 0001750 00000004145 11140366260 016010 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00133.html 0000755 0001750 0001750 00000010242 11140366257 015774 0 ustar ivan ivan
Loki: Loki::SpinLevelMutex Class Reference
Implements a spin-loop to wait for the mutex to unlock. Since this class makes the thread wait in a tight spin-loop, it can cause the thread to remain busy while waiting and thus consume CPU cycles. For that reason, this mutex is best used only for very low-level resources - especially resources which do not require much CPU time to exercise. Rule of thumb: Use this only if all actions on the resource consume a very small number of CPU cycles. Otherwise, use the SleepLevelMutex instead. The documentation for this class was generated from the following files:
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00448.html 0000755 0001750 0001750 00000003615 11140366261 016006 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::Chunk, including all inherited members.
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00218_g26dc37f18d3112b69b35514b5e1fd749_cgraph.dot 0000755 0001750 0001750 00000001163 11140366254 023616 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::operator==",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::StrongPtr::Equals",height=0.2,width=0.4,color="black",URL="$a00135.html#0c197e9b4f68669529435577357ffa57",tooltip="Helper function which can be called to avoid exposing GetPointer function."];
}
libloki-0.1.7.orig/doc/html/a00218_g26dc37f18d3112b69b35514b5e1fd749_cgraph.md5 0000755 0001750 0001750 00000000040 11140366254 023506 0 ustar ivan ivan ca45b4417f7d100df8fec30598fc6a49 libloki-0.1.7.orig/doc/html/a00006.html 0000755 0001750 0001750 00000005271 11140366256 016000 0 ustar ivan ivan
Loki: Loki::AmountLimitedCreation Class Reference
This implementation will prevent from Creating more than maxCreation objects within byTime ms by calling eviction policy. Use the setRate method to set the rate parameters. default is 10 objects.
The documentation for this class was generated from the following file:
CachedFactory.h
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00320.html 0000755 0001750 0001750 00000003721 11140366256 015775 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00075.html 0000755 0001750 0001750 00000005462 11140366255 016007 0 ustar ivan ivan
Loki: LockableTwoRefCounts Class Reference
This implementation of StrongPtr's OwnershipPolicy uses a pointer to a shared instance of LockableTwoRefCountInfo. It behaves very similarly to TwoRefCounts, except that it provides thread-safety. Some functions are trivial enough to be inline, while others are implemented elsewhere.
Note:
This class is not designed for use with a single-threaded model. Tests using a single-threaded model will not run properly, but tests in a multi-threaded model with either class-level-locking or object-level-locking do run properly.
The documentation for this class was generated from the following file:
StrongPtr.h
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00127_2b7fbd5bf5fc56e45754abd2497ad18f_cgraph.dot 0000755 0001750 0001750 00000002165 11140366261 024040 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::SmallObjAllocator::IsCorrupt",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::SmallObjAllocator::GetAlignment",height=0.2,width=0.4,color="black",URL="$a00127.html#b1c8a2a3d7e9368ab59422ddd082105c",tooltip="Returns # of bytes between allocation boundaries."];
Node1 -> Node3 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node3 [label="Loki::SmallObjAllocator::GetMaxObjectSize",height=0.2,width=0.4,color="black",URL="$a00127.html#e49e9de3fd7b2fd93676cc1d63299b0d",tooltip="Returns max # of bytes which this can allocate."];
Node1 -> Node4 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node4 [label="Loki::GetOffset",height=0.2,width=0.4,color="black",URL="$a00217.html#g2f0821e243f812a3ae2abfaea51895e8"];
}
libloki-0.1.7.orig/doc/html/a00127_2b7fbd5bf5fc56e45754abd2497ad18f_cgraph.md5 0000755 0001750 0001750 00000000040 11140366261 023725 0 ustar ivan ivan 73cffa1422867d06cb96929fafcd1b85 libloki-0.1.7.orig/doc/html/a00134.html 0000755 0001750 0001750 00000025226 11140366256 016004 0 ustar ivan ivan
Loki: Loki::StaticChecker< ExceptionPolicy > Class Template Reference
template<class ExceptionPolicy>
class Loki::StaticChecker< ExceptionPolicy >
This class checks if a function provides the no-throw exception safety level and if the function violated any invariants. Invariants for stand-alone and static functions act as pre-conditions and post-conditions.
Usage
Implement a function that checks the invariants associated with a function, or with the static data for a class. The function must have the signature similar to the Validator type. Something like: "static bool Host::StaticIsValid( void );" or "bool IsOkay( void );"
The function should return true if everything is okay, but false if something is wrong.
Or it could assert if anything is wrong.
If the checker is for static functions within a class, declare typedef's inside the class declaration like these. Make one typedef for each policy you use. I typedef'ed the CheckForNothing policy as CheckInvariants because even if a function can't provide the no-throw guarantee, it should still make sure that static data remains in a valid state.
Construct a checker near the top of each member function - except in the validator member function. Pass the address of your validator function into the checker's constructor.
If the function never throws, then use the CheckForNoThrow policy.
Otherwise use the CheckInvariants policy.
Recompile a debug version of your program, run it, and see if an assertion fails.
The destructor checks if any Host invariants failed, and then calls the ExceptionPolicy's Check function to determine what to do in case of an exception.
This first checks its own invariants, and then calls the validator function to make sure no invariants were broken by the function which created this checker. That function can call Check directly to verify the data remains valid at any time. This does not care if the pre- and post- condition validator pointers are null since a host class may pass in NULL pointers for either to indicate the pre-conditions or post-conditions are the same as the overall class invariants.
Implementation of the ArrayStorage used by SmartPtrThe documentation for this class was generated from the following file:
SmartPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00321.html 0000755 0001750 0001750 00000003731 11140366256 015777 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00076.html 0000755 0001750 0001750 00000013110 11140366261 015772 0 ustar ivan ivan
Loki: Loki::LockedStorage< T > Class Template Reference
Implementation of the StoragePolicy used by SmartPtr.
Each call to operator-> locks the object for the duration of a call to a member function of T.
How It Works
LockedStorage has a helper class called Locker, which acts as a smart pointer with limited abilities. LockedStorage::operator-> returns an unnamed temporary of type Locker<T> that exists for the duration of the call to a member function of T. The unnamed temporary locks the object when it is constructed by operator-> and unlocks the object when it is destructed.
Note:
This storage policy requires class T to have member functions Lock and Unlock. If your class does not have Lock or Unlock functions, you may either make a child class which does, or make a policy class similar to LockedStorage which calls other functions to lock the object.
The documentation for this class was generated from the following file:
SmartPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00070_d4ac0c2a33ff3d98ec0a83f70ce145da_cgraph.dot 0000755 0001750 0001750 00000004130 11140366257 024064 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Loki::LevelMutex::Lock",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node2 [label="Loki::LevelMutexInfo::GetLevel",height=0.2,width=0.4,color="black",URL="$a00071.html#1cad7c6b6fc50e230401e4cc22761d14",tooltip="Returns the level of this mutex."];
Node1 -> Node3 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node3 [label="Loki::LevelMutexInfo::IsLockedByCurrentThread",height=0.2,width=0.4,color="black",URL="$a00071.html#c0a343bcb322ea36495f536504f61f9f",tooltip="Returns true if this was locked by current thread."];
Node3 -> Node4 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node4 [label="Loki::LevelMutexInfo::IsLocked",height=0.2,width=0.4,color="black",URL="$a00071.html#e6aa7465e1bba7f0c9fbf0b06f122a39",tooltip="Returns true if this mutex was locked at least once."];
Node3 -> Node5 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node5 [label="Loki::LevelMutexInfo::IsValid",height=0.2,width=0.4,color="black",URL="$a00071.html#36c34ecf5d019f3db9bfb8654cf49176"];
Node5 -> Node6 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node6 [label="Loki::LevelMutexInfo::IsValidList",height=0.2,width=0.4,color="black",URL="$a00071.html#01f6dfba5d2ea5606109b34e5a543cf0"];
Node1 -> Node5 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node1 -> Node7 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node7 [label="Loki::LevelMutexInfo::PostLock",height=0.2,width=0.4,color="black",URL="$a00071.html#3fe2ecf1bcf2c49eae04c493f023099c"];
Node7 -> Node3 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node7 -> Node5 [color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
}
libloki-0.1.7.orig/doc/html/a00070_d4ac0c2a33ff3d98ec0a83f70ce145da_cgraph.md5 0000755 0001750 0001750 00000000040 11140366257 023757 0 ustar ivan ivan 2de39dbeab7d2e4c526779e8a8a7c830 libloki-0.1.7.orig/doc/html/a00390.html 0000755 0001750 0001750 00000005151 11140366260 015776 0 ustar ivan ivan
Loki: Member List
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Helper function which can be called to avoid exposing GetPointer function.
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Equality comparison operator is templated to handle ambiguity.
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Inequality comparison operator is templated to handle ambiguity.
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Less-than comparison operator is templated to handle ambiguity.
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Greater-than comparison operator is templated to handle ambiguity.
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Less-than-or-equal-to operator is templated to handle ambiguity.
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Greater-than-or-equal-to operator is templated to handle ambiguity.
Detailed Description
template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
class Loki::StrongPtr< T, Strong, OwnershipPolicy, ConversionPolicy, CheckingPolicy, ResetPolicy, DeletePolicy, ConstnessPolicy >
template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
Locks StrongPtr so other threads can't affect pointer. Requires the OwnershipPolicy to have Lock function.
template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
template<typename T1 , bool S1, class OP1 , class CP1 , template< class > class KP1, template< class > class RP1, template< class > class DP1, template< class > class CNP1>
Merges ownership of two StrongPtr's that point to same shared object but are not copointers. Requires Merge function in OwnershipPolicy.
Returns:
True for success, false if not pointer to same object.
template<typename T, bool Strong = true, class OwnershipPolicy = Loki::TwoRefCounts, class ConversionPolicy = Loki::DisallowConversion, template< class > class CheckingPolicy = Loki::AssertCheck, template< class > class ResetPolicy = Loki::CantResetWithStrong, template< class > class DeletePolicy = Loki::DeleteSingle, template< class > class ConstnessPolicy = LOKI_DEFAULT_CONSTNESS>
Generated on Thu Jan 29 18:51:47 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/functions_rela.html 0000755 0001750 0001750 00000004555 11140366255 020210 0 ustar ivan ivan
Loki: Class Members - Related Functions
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00008.html 0000755 0001750 0001750 00000005107 11140366256 016000 0 ustar ivan ivan
Loki: Loki::AssertAnyMutexError Class Reference
Implements the ErrorPolicy for LevelMutex and asserts for any error condition. Only allows MutexErrors::Success and MutexErrors::NoProblem to get through. Useful for testing mutexes in debug builds. The documentation for this class was generated from the following file:
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/functions_vars.html 0000755 0001750 0001750 00000004454 11140366255 020236 0 ustar ivan ivan
Loki: Class Members - Variables
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00322.html 0000755 0001750 0001750 00000003653 11140366256 016003 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00077.html 0000755 0001750 0001750 00000020012 11140366257 015777 0 ustar ivan ivan
Loki: Loki::LockingPtr< SharedObject, LockingPolicy, ConstPolicy > Class Template Reference
template<typename SharedObject, typename LockingPolicy = LOKI_DEFAULT_MUTEX, template< class > class ConstPolicy = LOKI_DEFAULT_CONSTNESS>
class Loki::LockingPtr< SharedObject, LockingPolicy, ConstPolicy >
Locks a volatile object and casts away volatility so that the object can be safely used in a single-threaded region of code. Original version of LockingPtr had only one template - for the shared object, but not the mutex type. This version allows users to specify a the mutex type as a LockingPolicy class. The only requirements for a LockingPolicy class are to provide Lock and Unlock methods.
Constructor & Destructor Documentation
template<typename SharedObject , typename LockingPolicy = LOKI_DEFAULT_MUTEX, template< class > class ConstPolicy = LOKI_DEFAULT_CONSTNESS>
Constructor locks mutex associated with an object.
Parameters:
lockpair
a std::pair of pointers to the object and the mutex
The documentation for this class was generated from the following file:
LockingPtr.h
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00391.html 0000755 0001750 0001750 00000003653 11140366260 016004 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::Singleton< T >, including all inherited members.
Generated on Thu Jan 29 18:51:44 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00136.html 0000755 0001750 0001750 00000005176 11140366256 016010 0 ustar ivan ivan
Loki: Loki::ThrowOnAnyMutexError Class Reference
Implements the ErrorPolicy for LevelMutex and throws an exception for any error condition. Only allows MutexErrors::Success and MutexErrors::NoProblem to get through. Useful for release builds. The documentation for this class was generated from the following files:
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00450.html 0000755 0001750 0001750 00000010221 11140366262 015767 0 ustar ivan ivan
Loki: Member List
Implements the ErrorPolicy for LevelMutex and asserts if the error indicates the programmer did not levelize the calls to mutexes. Otherwise returns the error result. Useful for testing mutexes in debug builds. The documentation for this class was generated from the following file:
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00078.html 0000755 0001750 0001750 00000025455 11140366256 016017 0 ustar ivan ivan
Loki: Loki::LokiAllocator< Type, AllocT > Class Template Reference
Adapts Loki's Small-Object Allocator for STL container classes. This class provides all the functionality required for STL allocators, but uses Loki's Small-Object Allocator to perform actual memory operations. Implementation comes from a post in Loki forums (by Rasmus Ekman?).
Allocate an array of count elements. Warning! The true parameter in the call to Allocate means this function can throw exceptions. This is better than not throwing, and returning a null pointer in case the caller assumes the return value is not null.
Parameters:
count
# of elements in array.
hint
Place where caller thinks allocation should occur.
Returns:
Pointer to block of memory.
The documentation for this class was generated from the following file:
Allocator.h
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00281.dot 0000755 0001750 0001750 00000003427 11140366255 015627 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="Visitor",height=0.2,width=0.4,color="black", fillcolor="grey75", style="filled" fontcolor="black"];
Node1 -> Node2 [dir=back,color="orange",fontsize="10",style="dashed",label="\",fontname="FreeSans"];
Node2 [label="Visitor\< Tail, R, false \>",height=0.2,width=0.4,color="black",URL="$a00142.html"];
Node1 -> Node3 [dir=back,color="orange",fontsize="10",style="dashed",label="\",fontname="FreeSans"];
Node3 [label="Visitor\< Head, R, false \>",height=0.2,width=0.4,color="black",URL="$a00142.html"];
Node1 -> Node4 [dir=back,color="orange",fontsize="10",style="dashed",label="\",fontname="FreeSans"];
Node4 [label="Visitor\< Head, R, true \>",height=0.2,width=0.4,color="black",URL="$a00142.html"];
Node1 -> Node5 [dir=back,color="orange",fontsize="10",style="dashed",label="\",fontname="FreeSans"];
Node5 [label="Visitor\< Head, R \>",height=0.2,width=0.4,color="black",URL="$a00142.html"];
Node1 -> Node6 [dir=back,color="orange",fontsize="10",style="dashed",label="\",fontname="FreeSans"];
Node6 [label="Visitor\< Tail, R, true \>",height=0.2,width=0.4,color="black",URL="$a00142.html"];
Node1 -> Node7 [dir=back,color="orange",fontsize="10",style="dashed",label="\",fontname="FreeSans"];
Node7 [label="Visitor\< TList, R \>",height=0.2,width=0.4,color="black",URL="$a00142.html"];
Node7 -> Node8 [dir=back,color="midnightblue",fontsize="10",style="solid",fontname="FreeSans"];
Node8 [label="Loki::CyclicVisitor\< R, TList \>",height=0.2,width=0.4,color="black",URL="$a00034.html"];
}
libloki-0.1.7.orig/doc/html/a00281.md5 0000755 0001750 0001750 00000000040 11140366255 015512 0 ustar ivan ivan a5be15b7e5dbdf700e31f1f689a55427 libloki-0.1.7.orig/doc/html/a00282.dot 0000755 0001750 0001750 00000000520 11140366255 015617 0 ustar ivan ivan digraph G
{
bgcolor="transparent";
edge [fontname="FreeSans",fontsize="10",labelfontname="FreeSans",labelfontsize="10"];
node [fontname="FreeSans",fontsize="10",shape=record];
rankdir=LR;
Node1 [label="AbstractFactory",height=0.2,width=0.4,color="black",URL="$a00001.html",tooltip="Implements an abstract object factory."];
}
libloki-0.1.7.orig/doc/html/a00282.md5 0000755 0001750 0001750 00000000040 11140366255 015513 0 ustar ivan ivan 108229591ea9a9149aec2085b42b44fa libloki-0.1.7.orig/doc/html/a00137.html 0000755 0001750 0001750 00000005242 11140366256 016003 0 ustar ivan ivan
Loki: Loki::ThrowOnBadDesignMutexError Class Reference
Implements the ErrorPolicy for LevelMutex and throws an exception if the error indicates the programmer did not levelize the calls to mutexes. Otherwise returns the error result. Useful for release builds. The documentation for this class was generated from the following files:
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00324.html 0000755 0001750 0001750 00000003651 11140366256 016003 0 ustar ivan ivan
Loki: Member List
Convert an allocator<Type> to an allocator <Type1>. The documentation for this struct was generated from the following file:
Allocator.h
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00138.html 0000755 0001750 0001750 00000005530 11140366262 016001 0 ustar ivan ivan
Loki: Loki::Private::TwoRefCountInfo Class Reference
Implementation detail for reference counting strong and weak pointers. It maintains a void pointer and 2 reference counts. Since it is just a class for managing implementation details, it is not intended to be used directly - which is why it is in a private namespace. Each instance is a shared resource for all copointers, and there should be only one of these for each set of copointers. This class is small, trivial, and inline. The documentation for this class was generated from the following file:
StrongPtr.h
Generated on Thu Jan 29 18:51:46 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00452.html 0000755 0001750 0001750 00000004003 11140366262 015772 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:46 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00010.html 0000755 0001750 0001750 00000005127 11140366261 015767 0 ustar ivan ivan
Loki: Loki::AssertCheck< P > Struct Template Reference
Implementation of the CheckingPolicy used by SmartPtr Checks the pointer before dereference The documentation for this struct was generated from the following file:
SmartPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00325.html 0000755 0001750 0001750 00000003665 11140366256 016011 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:42 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00394.html 0000755 0001750 0001750 00000007665 11140366261 016017 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00139.html 0000755 0001750 0001750 00000007753 11140366261 016012 0 ustar ivan ivan
Loki: Loki::TwoRefCounts Class Reference
This implementation of StrongPtr's OwnershipPolicy uses a pointer to a shared instance of TwoRefCountInfo. This is the default policy for OwnershipPolicy. Some functions are trivial enough to be inline, while others are implemented elsewhere. It is not thread safe, and is intended for single-threaded environments.
Constructor & Destructor Documentation
Loki::TwoRefCounts::~TwoRefCounts
(
void
)
[inline, protected]
The destructor does not need to do anything since the call to ZapPointer inside StrongPtr::~StrongPtr will do the cleanup which this dtor would have done.
The documentation for this class was generated from the following files:
StrongPtr.h
StrongPtr.cpp
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00011.html 0000755 0001750 0001750 00000005440 11140366261 015766 0 ustar ivan ivan
Loki: Loki::AssertCheckStrict< P > Struct Template Reference
template<class P>
struct Loki::AssertCheckStrict< P >
Implementation of the CheckingPolicy used by SmartPtr Checks the pointer against zero upon initialization and before dereference You can initialize an AssertCheckStrict with an AssertCheckThe documentation for this struct was generated from the following file:
SmartPtr.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/functions_func.html 0000755 0001750 0001750 00000053673 11140366255 020225 0 ustar ivan ivan
Loki: Class Members - Functions
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00326.html 0000755 0001750 0001750 00000003653 11140366257 016010 0 ustar ivan ivan
Loki: Member List
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00080.html 0000755 0001750 0001750 00000030313 11140366257 015776 0 ustar ivan ivan
Loki: Loki::MultiMutexLocker Class Reference
Provides access to the collection of mutexes controlled by this.
Detailed Description
You can place an instance of this as a local variable inside a function to lock a collection of mutexes. It locks them if no error occurs, or throws an exception if one does happen. When the function ends, the destructor determines if it needs to unlock the mutexes. This RAII technique insures the mutexes get unlocked even when exceptions occur. You will also have to construct a MutexContainer as a local object within the same function.
Creates an object to lock and unlock a collection of mutexes for a function. This will throw if an attempt to lock any mutex fails. If an exception occurs, it unlocks mutexes it previously locked.
Parameters:
mutex
Reference to a collection of mutexes.
lock
True if function wants to lock the mutex as this gets constructed.
Creates an object to lock and unlock a collection of mutexes for a function. This waits a specified amount of time for other threads to unlock each mutex that is locked. This will throw if an attempt to lock any mutex fails. If an exception occurs, it unlocks mutexes it previously locked.
Parameters:
mutexes
Reference to a collection of mutexes.
milliSeconds
Amount of time to wait for another thread to unlock the mutex.
lock
True if function wants to lock the mutexes as this gets constructed.
You can call this to lock (or relock) the mutexes. In theory, you can lock and unlock mutexes several times within a function in order to give other threads access to resources while this function does not need them.
Returns:
True if mutex is locked by this, else false if not locked.
You can call this to unlock the mutexes before the destructor does it. By unlocking the mutexes before returning, the function can do other operations without making other threads wait too long.
Returns:
True if unlocked by this, else false if not unlocked by this. (Which is not the same as whether the mutex itself is locked or not by another thread.)
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/hierarchy.html 0000755 0001750 0001750 00000041210 11140366255 017140 0 ustar ivan ivan
Loki: Hierarchical Index
Generated on Thu Jan 29 18:51:41 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00012.html 0000755 0001750 0001750 00000004637 11140366261 015776 0 ustar ivan ivan
Loki: Loki::BaseVisitor Class Reference
The base class of any Acyclic VisitorThe documentation for this class was generated from the following file:
Visitor.h
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00327.html 0000755 0001750 0001750 00000003631 11140366257 016005 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::NoMutexWait, including all inherited members.
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00081.html 0000755 0001750 0001750 00000004654 11140366261 016003 0 ustar ivan ivan
Loki: Loki::Mutex Class Reference
This implementation of StrongPtr's OwnershipPolicy uses a doubly-linked cycle of copointers to a shared object. Some functions are trivial enough to be inline, while others are implemented in elsewhere. It is not thread safe, and is intended for single-threaded environments.
The documentation for this class was generated from the following files:
StrongPtr.h
StrongPtr.cpp
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00455.html 0000755 0001750 0001750 00000003715 11140366262 016006 0 ustar ivan ivan
Loki: Member List
This is the complete list of members for Loki::MutexSleepWaits, including all inherited members.
Generated on Thu Jan 29 18:51:43 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00082.html 0000755 0001750 0001750 00000017131 11140366257 016003 0 ustar ivan ivan
Loki: Loki::MutexException Class Reference
Exception class used to throw error statuses about LevelMutex's up to code that can respond to mutex problems. This class exists because it conveys more info about the error condition than just std::exception.
Constructor & Destructor Documentation
Loki::MutexException::MutexException
(
const char *
message,
unsigned int
level,
MutexErrors::Type
reason
)
Constructs an exception which stores information about a mutex and the reason an attempt to use a mutex failed.
The documentation for this class was generated from the following files:
Generated on Thu Jan 29 18:51:45 2009 for Loki by
1.5.8
libloki-0.1.7.orig/doc/html/a00141.html 0000755 0001750 0001750 00000005531 11140366257 016000 0 ustar ivan ivan
Loki: Loki::UnRegisterOnDeleteSet< ElementList > Class Template Reference