![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
![]() [Introduction] [Overview] [Core reference] [3D reference] [GUI] IndexERes_ResourceListDefinitionToBinaryImage ERes_ResourceListDefinitionFromBinaryImage ERes_ToBinaryImage ERes_ListsToBinaryImage EResourceList_Copy EResource_Offset EResource_OffsetByType EResources_CountBySemantic EResource_OffsetByIndex ERes_ResourceListDefinitionToBinaryImageConvert Resource list definition to a binary image "dictionary"Syntax Arguments Description Converts a Resource list definition to an architecture-independent binary format to be saved into a file or sent through the network. This "definition" may then be used for multiple instances of a class that uses those Resources. This allows for the Resource values for those multiple instances to be stored in a more efficient way (the Resource names and types won't be stored with every instance). PBinaryImage specifies where to store the data. It's not necessarily stored a the beginning of the buffer (PContext->BinaryImage) because the caller may want to buffer several things before sending the data to the output (e.g. to a file). PContext->BinaryImage is grown as necessary, to accomodate the data. Return value None. ERes_ResourceListDefinitionFromBinaryImageLoad Resource "dictionary" (Name/Type pairs) from a binary imageSyntax Arguments Description Loads a Resource list definition list from an architecture-independent binary format. Return value None. See also ERes_ToBinaryImageConvert a Resource list to a binary image (serializing)Syntax Arguments Description Converts a resource list to an architecture-independent binary format to be saved into a file, sent through the network, etc. If (PContext->FormatFlags & EResNAMES) != 0, the names of Resources will be saved. If (PContext->FormatFlags & EResTYPES) != 0, the types of Resources will be saved. The better alternative is to save a "dictionary" of type/name lists for each oblect class, and just refer to those, then pass FALSE for this function. For example, E3dScene_CollectClassesAndObjects() does this in libE3D (EQUINOX-3D, FusionEngine etc.). However, if you don't want to implement dictionary saving / restoring, you can just pass TRUE here. If PStructAddress is NULL, the addresses in PResources will be considered absolute addresses, otherwise as offsets relative to PStructAddress. PBufferPtr holds the address to the beginning of the WHOLE memory buffer, while PBinaryImagePtr has the pointer to where the image should be stored. These may be different if there is already data in the LAllocatedBuffer. This allows for storing multiple binary images in a contigous memory block. If PBinaryImagePtr is NULL, the binary image will be stored from the beginning of PBufferPtr. EResources can reference reflective objects (derived from ECoreObject) and PReferencedObjectsP (treated as ECoreObject***) will contain a list of those. This list is accumulated through multiple calls to ERes_ToBinaryImage and each ECoreObject will only occur once in the list. This allows for saving a global list of object references and then rebuilding references when the database is reloaded. For example, the construction history for the "Revolve" tool in EQUINOX-3D references the original profile Spline as an EResource. Return value None. ERes_ListsToBinaryImageConvert resource list to binary imageSyntax Arguments Description Converts a resource list to an architecture-independent binary format to be saved into a file or sent through the network. If PStructAddress is NULL, the addresses in PResources will be considered as absolute addresses, otherwise as offsets relative to PStructAddress. PBufferPtr holds the address to the beginning of the WHOLE memory buffer, while PBinaryImagePtr has the pointer to where the image should be stored. If PBinaryImagePtr is NULL, the result will be stored at the beginning of the Buffer. These might be different if there is already data in the LAllocatedBuffer. This allows for storing multiple binary images in a contigous memory block. Return value None. EResourceList_CopyCopy Resource listSyntax Arguments Description Copies a Resource list. If PDstResources points to a non-empty list that list will be freed first. If PFlags contains EResNAME_STATIC: - Any non-NULL Name members will be freed of a non-empty list. - Names will be deep-copied (vs the pointer being assigned directly) Return value E_SUCCESS, or an error code. EResource_OffsetCompute byte offset of a Resource, specified by semantic and indexSyntax Arguments Description Returns the byte offset of the given Resource. If PIndex is >=0, it's is used to identify the Attribute with the same If PIndex is -1, PIndex is used instead. Return value None. EResource_OffsetByTypeCompute byte offset of a Resource, specified by semantic and indexSyntax Arguments Description Returns the byte offset of the given Resource. If PIndex is >=0, it's is used to identify the Attribute with the same Semantic If PIndex is -1, PName is used instead. Return value The byte offset of the EResource found, or -1 if no match exists. EResources_CountBySemanticCount the number or EResources in a list by SemanticSyntax Arguments Description Returns number or EResources in PList that have the given Semantic. Return value The number or EResources found. EResource_OffsetByIndexCompute byte offset of a Resource, specified by the indexSyntax Arguments Description Returns the byte offset of the given Resource. Return value None. |