fid.h File Reference

Classes

class  FId< T, KEYTYPE >
 
class  FId< T, InternedId >
 
class  PrivateGetFIdKeyType< T >
 
class  PrivateGetFIdKeyType< const char(&)[N]>
 
class  InternedIdSwitch
 
class  IdSwitch
 
class  DataIdSwitch
 
class  IdSwitchCheck< BASE >
 
class  RESTRICT
 

Namespaces

 maxon
 
 maxon::details
 

Macros

#define FID(IID, TYPE)
 
#define RESOURCE_DEFINE(ID, VAL)
 
#define RESOURCE_DEFAULT(...)
 
#define MAXON_RESOURCE_DATABASE_SCOPE(id)
 
#define PRIVATE_RESOURCE_ID_CLASS(UID, IID, TYPE, BODY, ...)
 
#define PRIVATE_RESOURCE_ID_DECL(STORAGE, UID)
 
#define MAXON_ATTRIBUTE(TYPE, NAME, RID, ...)
 
#define MAXON_ATTRIBUTE_CLASS(TYPE, NAME, RID, ...)
 
#define MAXON_ATTRIBUTE_LOCAL(TYPE, NAME, RID, ...)
 
#define ID_SWITCH(key)
 
#define PRIVATE_ID_CASE(key, line)
 
#define ID_CASE(key)
 

Typedefs

using Group = void
 

Functions

maxon::Id PrivateGetDatabaseScope ()
 
 MAXON_MEMBERTYPE_DETECTOR (IsFidClass, FidType, std::false_type)
 
IdSwitchCheck< InternedIdSwitch > GetIdSwitch (const InternedId &iid, OverloadRank2)
 
IdSwitchCheck< InternedIdSwitch > GetIdSwitch (const InternedId *iid, OverloadRank2)
 
IdSwitchCheck< IdSwitch > GetIdSwitch (const Id &id, OverloadRank1)
 
IdSwitchCheck< DataIdSwitch > GetIdSwitch (const ConstDataPtr &data, OverloadRank0)
 
IdSwitchCheck< DataIdSwitch > GetIdSwitch (const ForwardingDataPtr &data, OverloadRank0)
 
template<typename RESTRICT , Bool ONLYFID, typename KEY >
std::enable_if<!IsFidClass< KEY >::value, typename std::conditional< STD_IS_REPLACEMENT(reference, KEY)||STD_IS_REPLACEMENT(const, KEY), ConstDataPtr, MoveDataPtr >::type >::type ConvertKeyToDataPtr (KEY &&key)
 
template<typename RESTRICT , Bool ONLYFID, typename KEY >
std::enable_if< IsFidClass< KEY >::value, ConstDataPtr >::type ConvertKeyToDataPtr (KEY &&key)
 
template<typename T >
RESTRICT TestRestriction (T y, OverloadRank0)
 
 MAXON_MEMBERTYPE_DETECTOR (GetRestrict, RESTRICT_DICTIONARY_PROPS, maxon::RESTRICT)
 

Macro Definition Documentation

◆ FID

#define FID (   IID,
  TYPE 
)

Defines a resource id with type. E.g. FID(1000, Real) allows to set this type directly into a DataDictionary. The Set()/Get() of the DataDictionary then is type checked.

◆ RESOURCE_DEFINE

#define RESOURCE_DEFINE (   ID,
  VAL 
)

◆ RESOURCE_DEFAULT

#define RESOURCE_DEFAULT (   ...)

defines the default value

◆ MAXON_RESOURCE_DATABASE_SCOPE

#define MAXON_RESOURCE_DATABASE_SCOPE (   id)

◆ PRIVATE_RESOURCE_ID_CLASS

#define PRIVATE_RESOURCE_ID_CLASS (   UID,
  IID,
  TYPE,
  BODY,
  ... 
)

◆ PRIVATE_RESOURCE_ID_DECL

#define PRIVATE_RESOURCE_ID_DECL (   STORAGE,
  UID 
)

◆ MAXON_ATTRIBUTE

#define MAXON_ATTRIBUTE (   TYPE,
  NAME,
  RID,
  ... 
)

Declares a resource id with type in the current namespace. E.g.,

COLOR
Vector.
Definition: c4d_basebitmap.h:5
#define MAXON_ATTRIBUTE(TYPE, NAME, RID,...)
Definition: fid.h:156

declares a resource id COLOR in the current namespace which uses 1000 as its key in dictionaries and has values of type Vector32. You have to make sure that you don't use different resource ids with equal key in the same dictionary. TODO: (Anybody) naming convention.

Parameters
[in]TYPEThe type of the values of this resource id.
[in]NAMEThe C++ name of the resource id. A global variable of that name will be added to the current namespace.
[in]RIDThe resource id to be used as key in dictionaries. This can be of any type which is supported by DataType. A c-string literal will be treated as an InternedId.
[in]...Further information about the resource.
Note
The macro itself leaves incomplete code which is completed by the source processor. So you have to place the macro in a header file, because the source processor only scans header files, and you have to include the generated hxx files in the header file.

◆ MAXON_ATTRIBUTE_CLASS

#define MAXON_ATTRIBUTE_CLASS (   TYPE,
  NAME,
  RID,
  ... 
)

Declares a resource id with type as a class member in the current class. E.g.,

MAXON_ATTRIBUTE_CLASS(Bool, WideningConversion, "widening");
#define MAXON_ATTRIBUTE_CLASS(TYPE, NAME, RID,...)
Definition: fid.h:175
maxon::Bool Bool
Definition: ge_sys_math.h:55

declares a resource id WideningConversion in the current class which uses "widening" as its key in dictionaries and has values of type Bool. You have to make sure that you don't use different resource ids with equal key in the same dictionary. TODO: (Anybody) naming convention.

Parameters
[in]TYPEThe type of the values of this resource id.
[in]NAMEThe C++ name of the resource id. A static member variable of that name will be added to the current class.
[in]RIDThe resource id to be used as key in dictionaries. This can be of any type which is supported by DataType. A c-string literal will be treated as an InternedId.
[in]...Further information about the resource.
Note
The macro itself leaves incomplete code which is completed by the source processor. So you have to place the macro in a header file, because the source processor only scans header files, and you have to include the generated hxx files in the header file.

◆ MAXON_ATTRIBUTE_LOCAL

#define MAXON_ATTRIBUTE_LOCAL (   TYPE,
  NAME,
  RID,
  ... 
)

Declares a resource id with type in the current namespace. Unlike the other MAXON_ATTRIBUTE macros, this macro has to be used in a cpp file. E.g.,

MAXON_ATTRIBUTE_LOCAL(IoMemoryRef, URL_MEMORY_REF, 'memo');
#define MAXON_ATTRIBUTE_LOCAL(TYPE, NAME, RID,...)
Definition: fid.h:192

declares a resource id URL_MEMORY_REF in the current namespace which uses 'memo' as its key in dictionaries and has values of type IoMemoryRef. You have to make sure that you don't use different resource ids with equal key in the same dictionary. TODO: (Anybody) naming convention.

Parameters
[in]TYPEThe type of the values of this resource id.
[in]NAMEThe C++ name of the resource id. A static member variable of that name will be added to the current class.
[in]RIDThe resource id to be used as key in dictionaries. This can be of any type which is supported by DataType. A c-string literal will be treated as an InternedId.
[in]...Further information about the resource.

◆ ID_SWITCH

#define ID_SWITCH (   key)

ID_SWITCH and ID_CASE allow to use Id or InternedId values in a switch statement. ID_SWITCH has to wrap the switch expression, it supports switch expressions of type Id, InternedId, pointer to InternedId or ConstDataPtr/ForwardingDataPtr. Each case label has to be wrapped by ID_CASE, this supports ids that are declared by MAXON_INTERNED_ID, MAXON_DECLARATION or MAXON_ATTRIBUTE. Example:

switch (ID_SWITCH(key))
{
case ID_CASE(STREAMFLAGS::HTTP_REMOTEADDRESS):
return Data(_httpFile.GetRemoteAddr());
break;
case ID_CASE(STREAMFLAGS::HTTP_HEADER):
return Data(_httpFile.GetHeader());
break;
}
PyObject * key
Definition: abstract.h:289
#define ID_SWITCH(key)
Definition: fid.h:359
#define ID_CASE(key)
Definition: fid.h:372
Parameters
[in]keyThe key to be used for the switch expression.
Note
These macros also support fallthroughs and multiple values for a single case block. Nesting of switch statements will most likely cause a warning about a shadowed local variable because each ID_SWITCH macro declares a local variable of name privateSwitchId in the scope of the switch statement.
You will get a compile-time error in the rare case that two ids have the same hashcode. In this case you can't use a switch statement, you have to use if statements instead.

◆ PRIVATE_ID_CASE

#define PRIVATE_ID_CASE (   key,
  line 
)

◆ ID_CASE

#define ID_CASE (   key)

ID_SWITCH and ID_CASE allow to use InternedId values in a switch statement, see ID_SWITCH.

Parameters
[in]keyThe key to be used for the case.

Function Documentation

◆ PrivateGetDatabaseScope()

maxon::Id PrivateGetDatabaseScope ( )