FXGenericTools.h File Reference


Detailed Description

Defines a number of tools useful for generic programming.

#include "FXString.h"
#include "FXPolicies.h"
#include "FXException.h"
#include "FXPath.h"
#include <typeinfo>
#include <assert.h>

Include dependency graph for FXGenericTools.h:

This graph shows which files directly or indirectly include this file:


Namespaces

namespace  FX
namespace  FX::Generic
namespace  Generic
namespace  FX::Generic::convertiblePrivate
namespace  TL
namespace  FX::Generic::TL
namespace  FX::Generic::TL::numberRangePrivate
namespace  FX::Generic::TL::Private
namespace  FX::Generic::FnFromListPrivate
namespace  ClassTraits
namespace  FX::Generic::ClassTraits
namespace  FX::Generic::TraitsHelper
namespace  FX::Generic::FunctorHelper
namespace  FX::Generic::TL::dynamicAtHelper

Classes

struct  FX::Generic::NullType
 A type representing no type (ie; end of list etc). More...
struct  FX::Generic::IntToType< n >
 A small template which maps any int to a type (and thus allows number-based overloading and type specialisation - and thus compile-time determined code generation). More...
struct  FX::Generic::TypeToType< type >
 A small template which maps any type to a lightweight type suitable for overloading eg; functions. More...
struct  FX::Generic::Boolean< v, type >
 A small template whose value is v. Useful for delayed static assertions. More...
struct  FX::Generic::select< v, A, B >
 Selects one of two types based upon a boolean. More...
struct  FX::Generic::sameType< A, B >
 Returns true if the two types are the same. More...
struct  FX::Generic::addRef< type >
 Adds a reference indirection unless type already has one. More...
struct  FX::Generic::addConstRef< type >
 Ensures a type is a const reference. More...
struct  FX::Generic::convertible< to, from >
 Returns true if from can become to. More...
struct  FX::Generic::lessIndir< ptr >
 Removes if possible a level of indirection from a pointer or reference type. More...
struct  FX::Generic::indirs< type >
 Returns how many levels of indirection this type has eg; int ** is two. More...
struct  FX::Generic::leastIndir< ptr >
 Removes all levels of indirection from a pointer or reference type. More...
class  FX::Generic::typeInfoBase
 Base class for FX::Generic::typeInfo. More...
struct  FX::Generic::typeInfo< type >
 Enhanced version of std::type_info. More...
class  FX::Generic::ptr< type, ownershipPolicy >
 A policy-based smart pointer. More...
struct  FX::Generic::TL::item< A, B >
 A single item within the list. More...
struct  FX::Generic::TL::create< T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 >
 Creates a typelist with up to 16 types. More...
struct  FX::Generic::TL::length< typelist >
 Determines the length of a typelist. More...
struct  FX::Generic::TL::at< typelist, idx >
 Returns the type at index idx, returning NullType if out of bounds. More...
struct  FX::Generic::TL::atC< typelist, idx >
 Returns the type at index idx, throwing an error if out of bounds. More...
struct  FX::Generic::TL::find< typelist, type >
 Returns the index of the specified type in the list or -1 if not found. More...
struct  FX::Generic::TL::findC< typelist, type >
 Returns the index of the specified type in the list, throwing an error if not found. More...
struct  FX::Generic::TL::findParent< typelist, type >
 Returns the index of the first parent class of the specified type in the list or -1 if not found. More...
struct  FX::Generic::TL::findParentC< typelist, type >
 Returns the index of the specified type in the list, throwing an error if not found. More...
struct  FX::Generic::TL::append< typelist, type >
 Appends a type or typelist. More...
struct  FX::Generic::TL::remove< typelist, type >
 Removes a type from a list. More...
struct  FX::Generic::TL::numberRange< no, instance >
 Creates a typelist composed of types instantiated by a number running from 0 to no. More...
struct  FX::Generic::TL::apply< typelist, instance >
 Applies each type in a typelist to the template instance, returning a typelist. More...
struct  FX::Generic::TL::filter< typelist, filt >
 Reduces from a typelist to another based on a binary predicate. More...
struct  FX::Generic::TL::replicate< no, type >
 Generates a typelist of no copies of a type. More...
struct  FX::Generic::TL::instanceHolderH< type >
 Default holder for instanceH. More...
struct  FX::Generic::TL::instantiateH< typelist, instance, idx >
 Horizontally instantiates a container containing a holder for each item in a typelist. More...
struct  FX::Generic::FnInfo< fn >
 Extracts type information from a function pointer type. More...
struct  FX::Generic::FnFromList< list >
 Converts a typelist into a function pointer type. More...
struct  FX::Generic::IntegralLists
 A series of typelists of kinds of integral type. More...
struct  FX::Generic::BiggestValue< type, minus >
 Returns the biggest positive or negative value which can be stored in an integral type. More...
struct  FX::Generic::SmallestValue< type, minus >
 Returns the smallest positive or negative value which can be stored in an integral type. More...
struct  FX::Generic::ClassTraits::combine< T1 >
 Combines class traits when specialising a type. More...
struct  FX::Generic::ClassTraits::has< type >
 Permits you to specify qualities of a type. More...
class  FX::Generic::Traits< type >
 Determines qualities of a type via introspection. More...
class  FX::Generic::Functor< parslist >
 Represents a callable API. More...
class  FX::Generic::BoundFunctorV
 A call to a specific API with specific arguments, throwing away the return. More...
class  FX::Generic::BoundFunctor< parslist >
 A call to a specific API with specific arguments. More...
struct  FX::Generic::TL::dynamicAt< typelist, instance >
 Assembles code to call some templated code with the type from a typelist. More...
struct  FX::Generic::MapBools< len >
 Mapper of C++ bools to a bitfield. More...
class  FX::Generic::DoUndo< obj, doaddr, undoaddr >
 Performs an action on construction and another action on destruction. More...
class  FX::FXUnicodify< fastlen >
 Converts a UTF-8 format FX::FXString into a unicode string suitable for the host operating system. More...

Defines

#define FXSTATIC_ASSERT2(expr, msg)
#define FXSTATIC_ASSERT(expr, msg)
#define FXTYPELIST1(P1)
#define FXTYPELIST2(P1, P2)
#define FXTYPELIST3(P1, P2, P3)
#define FXTYPELIST4(P1, P2, P3, P4)
#define FXTYPELIST5(P1, P2, P3, P4, P5)
#define FXTYPELIST6(P1, P2, P3, P4, P5, P6)
#define FXTYPELIST7(P1, P2, P3, P4, P5, P6, P7)
#define FXTYPELIST8(P1, P2, P3, P4, P5, P6, P7, P8)
#define FXTYPELIST9(P1, P2, P3, P4, P5, P6, P7, P8, P9)
#define FXTYPELIST10(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10)
#define FXTYPELIST11(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)
#define FXTYPELIST12(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12)
#define FXTYPELIST13(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13)
#define FXTYPELIST14(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14)
#define FXTYPELIST15(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15)
#define FXTYPELIST16(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16)
#define FXAutoPtr

Typedefs

typedef std::type_info FX::Generic::type_info

Functions

template<int i, class container>
Private::accessInstantiateH< i,
container >::IdxType & 
FX::Generic::TL::instance (container &c)
BoundFunctor FX::Generic::BindFunctor (FX::Generic::Functor &functor[, par1[, par2...]])
BoundFunctor * FX::Generic::BindFunctorN (FX::Generic::Functor &functor[, par1[, par2...]])
BoundFunctor FX::Generic::BindFunc (functptr[, par1[, par2...]])
BoundFunctor FX::Generic::BindFuncN (functptr[, par1[, par2...]])
BoundFunctor FX::Generic::BindObj (obj &, memfunctptr[, par1[, par2...]])
BoundFunctor FX::Generic::BindObjN (obj &, memfunctptr[, par1[, par2...]])

Define Documentation

#define FXAutoPtr

Defined as a FX::Generic::ptr<FX::Pol::destructiveCopy> which means it works semantically the same as std::auto_ptr. If you see this in a parameter list, it means that the API takes ownership of the pointer - deleting it if there's an exception as well as deleting it when done with the pointer. Usually functions accepting a FXAutoPtr check their input for zero, thus you can use new directly inside the API eg;

type *foo(FXAutoPtr<type> ptr);
...
type *handle=foo(new type);


(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 21:54:47 2008 for TnFOX by doxygen v1.5.6