templates.bi

Copyright © 2007-2011, FreeBASIC Extended Library Development Group

Distributed under the FreeBASIC Extended Library Group license.  See accompanying file LICENSE.txt or copy at http://code.google.com/p/fb-extended-lib/wiki/License

Summary
templates.biCopyright © 2007-2011, FreeBASIC Extended Library Development Group
Macros
fbext_TypeNameGets the qualified name of T_, which is often a template type parameter.
fbext_TypeIDGets the concatenated name of T_, which is often a template type parameter.
fbext_TIDGets the concatenated name of T_, which is often a template type parameter.
fbext_TemplateID
fbext_TDeclareDeclares the template tname_ with targs_.
fbext_TDefineDefines the template tname_ with targs_.
fbext_InstanciateFully instanciates the template tname_ with arguments targs_.
fbext_InstanciateMultiFully instanciates the template tname_ with each set of arguments in seq_of_targs_.
fbext_UnsignedIntegralTypesA preprocessor sequence of unsigned integral types.
fbext_SignedIntegralTypesA preprocessor sequence of signed integral types.
fbext_IntegralTypesA preprocessor sequence of integral types.
fbext_FloatTypesA preprocessor sequence of floating-point types.
fbext_NumericTypesA preprocessor sequence of numeric types.

Macros

fbext_TypeName

# define fbext_TypeName(
   T_
) fbextPP_SeqCat(fbextPP_SeqForEachI(fbext_TypeName_I, __, T_))

Gets the qualified name of T_, which is often a template type parameter.

Parameters

T_a template parameter.

fbext_TypeName is most often used in template declarations and template definitions to transform a template type parameter into an identifier suitable for use in statements such as Dim and in procedure parameter declarations.

For example, fbext_TypeName((MyNamespace)(MyType)) expands to MyNamespace.MyType.

fbext_TypeID

# define fbext_TypeID(T_) fbextPP_SeqCat(T_)

Gets the concatenated name of T_, which is often a template type parameter.

Parameters

T_a template parameter.

fbext_TypeName is used to transform a template type parameter into an identifier suitable for a macro name.

For example, fbext_TypeID((MyNamespace)(MyType)) expands to MyNamespaceMyType.

fbext_TID

# define fbext_TID(
   tname_,
   targs_
) fbext_TypeID((tname_) fbextPP_SeqTransform(fbext_TID_O, __, targs_))

Gets the concatenated name of T_, which is often a template type parameter.

Parameters

tname_a template name.
targs_a sequence of one or more template arguments.

fbext_TID is used to transform a template name and a sequence of template arguments into an identifier suitable for a macro name.

For example, fbext_TID((MyNamespace)(MyType)) expands to MyNamespaceMyType.

fbext_TemplateID

# define fbext_TemplateID(
   tname_,
   targs_,
   deftargs_
) fbext_TemplateID_I( tname_, fbext_GetTArgsWithDefaults__( targs_, deftargs_) )

fbext_TDeclare

# macro fbext_TDeclare(tname_,
targs_)

Declares the template tname_ with targs_.

Parameters

tname_the name of the template.
targs_a sequence of one or more template arguments.

fbext_TDeclare expands the macro *tname_*##_Declare with each of the elements in targs_ as arguments.  No expansion occurs if *tname_*##_Declare is not defined, or if it has already been expanded with the given arguments.

fbext_TDefine

# macro fbext_TDefine(tname_,
linkage_,
targs_)

Defines the template tname_ with targs_.

Parameters

tname_the name of the template.
linkage_”public” or “private” specifying, respectively, external or internal linkage.
targs_a sequence of one or more template arguments.

fbext_TDefine expands the macro *tname_*##_Define with linkage_ and each of the elements in targs_ as arguments.  No expansion occurs if *tname_*##_Define is not defined, or if it has already been expanded with the given arguments.

fbext_Instanciate

# macro fbext_Instanciate(tname_,
targs_)

Fully instanciates the template tname_ with arguments targs_.

Parameters

tname_the name of the template to instanciate.
targs_a sequence of one or more template arguments.

fbext_Instanciate effectively behaves like,

fbext_TDeclare(tname_, targs_)
fbext_TDefine(tname_, private, targs_)

fbext_InstanciateMulti

# macro fbext_InstanciateMulti(tname_,
seq_of_targs_)

Fully instanciates the template tname_ with each set of arguments in seq_of_targs_.

Parameters

tname_the name of the template to instanciate.
seq_of_targs_a sequence of one or more sequences of one or more template arguments.

fbext_InstanciateMulti effectively behaves like,

fbext_Instanciate(tname_, fbextPP_SeqElem(0, seq_of_targs))
fbext_Instanciate(tname_, fbextPP_SeqElem(1, seq_of_targs))
    ...
fbext_Instanciate(tname_, fbextPP_SeqElem(N-1, seq_of_targs))

where N is the number of sequences of template arguments in seq_of_targs.

fbext_UnsignedIntegralTypes

# define fbext_UnsignedIntegralTypes(
   
) (((ubyte)))(((ushort)))(((uinteger)))(((ulongint)))

A preprocessor sequence of unsigned integral types.

fbext_SignedIntegralTypes

# define fbext_SignedIntegralTypes(
   
) (((byte)))(((short)))(((integer)))(((longint)))

A preprocessor sequence of signed integral types.

fbext_IntegralTypes

# define fbext_IntegralTypes(
   
) fbext_UnsignedIntegralTypes() fbext_SignedIntegralTypes()

A preprocessor sequence of integral types.

fbext_FloatTypes

# define fbext_FloatTypes() (((single)))(((double)))

A preprocessor sequence of floating-point types.

fbext_NumericTypes

# define fbext_NumericTypes() fbext_IntegralTypes() fbext_FloatTypes()

A preprocessor sequence of numeric types.

# define fbext_TypeName(
   T_
) fbextPP_SeqCat(fbextPP_SeqForEachI(fbext_TypeName_I, __, T_))
Gets the qualified name of T_, which is often a template type parameter.
# define fbext_TypeID(T_) fbextPP_SeqCat(T_)
Gets the concatenated name of T_, which is often a template type parameter.
# define fbext_TID(
   tname_,
   targs_
) fbext_TypeID((tname_) fbextPP_SeqTransform(fbext_TID_O, __, targs_))
Gets the concatenated name of T_, which is often a template type parameter.
# define fbext_TemplateID(
   tname_,
   targs_,
   deftargs_
) fbext_TemplateID_I( tname_, fbext_GetTArgsWithDefaults__( targs_, deftargs_) )
# macro fbext_TDeclare(tname_,
targs_)
Declares the template tname_ with targs_.
# macro fbext_TDefine(tname_,
linkage_,
targs_)
Defines the template tname_ with targs_.
# macro fbext_Instanciate(tname_,
targs_)
Fully instanciates the template tname_ with arguments targs_.
# macro fbext_InstanciateMulti(tname_,
seq_of_targs_)
Fully instanciates the template tname_ with each set of arguments in seq_of_targs_.
# define fbext_UnsignedIntegralTypes(
   
) (((ubyte)))(((ushort)))(((uinteger)))(((ulongint)))
A preprocessor sequence of unsigned integral types.
# define fbext_SignedIntegralTypes(
   
) (((byte)))(((short)))(((integer)))(((longint)))
A preprocessor sequence of signed integral types.
# define fbext_IntegralTypes(
   
) fbext_UnsignedIntegralTypes() fbext_SignedIntegralTypes()
A preprocessor sequence of integral types.
# define fbext_FloatTypes() (((single)))(((double)))
A preprocessor sequence of floating-point types.
# define fbext_NumericTypes() fbext_IntegralTypes() fbext_FloatTypes()
A preprocessor sequence of numeric types.