All Classes Functions Variables Properties
List of all members | Public Member Functions | Properties
ICWFGM_FuelMap Class Reference

Interface ICWFGM FuelMap. More...

import "GridCOM.idl";

Collaboration diagram for ICWFGM_FuelMap:
Collaboration graph

Public Member Functions

HRESULT MT_Lock ([in] unsigned short exclusive, [in] unsigned short obtain)
 
HRESULT Copy ([in]ICWFGM_FuelMap *toCopy)
 
HRESULT Clone ([out]ICWFGM_FuelMap **newFuelMap)
 
HRESULT GetFuelCount ([out]unsigned char *count, [out, retval]unsigned char *unique_count)
 
HRESULT AddFuel ([in]ICWFGM_Fuel *fuel, [in]long file_index, [in]long export_file_index, [out, retval]unsigned char *fuel_index)
 
HRESULT RemoveFuel ([in]ICWFGM_Fuel *fuel)
 
HRESULT FuelAtIndex ([in]unsigned char fuel_index, [out]long *file_index, [out]long *export_file_index, [out, retval]ICWFGM_Fuel **fuel)
 
HRESULT FuelAtFileIndex ([in]long file_index, [out]unsigned char *fuel_index, [out]long *export_file_index, [out, retval]ICWFGM_Fuel **fuel)
 
HRESULT IndexOfFuel ([in]ICWFGM_Fuel *fuel, [out]long *file_index, [out]long *export_file_index, [in, out]unsigned char *fuel_index)
 
HRESULT RemoveFuelIndex ([in]ICWFGM_Fuel *fuel, [in]long file_index)
 
HRESULT GetAvailableFileIndex ([out]long *index)
 
HRESULT GetAttribute ([in]unsigned short option, [out, retval]VARIANT *value)
 
HRESULT SetAttribute ([in]unsigned short option, [in]VARIANT value)
 

Properties

VARIANT UserData [get, set]
 

Detailed Description

Interface ICWFGM FuelMap.

A CWFGM FuelMap retains relationships between CWFGM fuels and their associated grid file and internal indices. The grid file indices are predetermined when the files are exported from the GIS. The FuelMap object assigns but may not change internal indexes. The FuelMap may retain up to 255 unique relationships. This object also implements the standard COM IPersistStream, IPersistStreamInit, and IPersisStorage interfaces, for use for loading and saving. Serialization methods declared in these interfaces save the associations as well as the fuel types. The client application must be careful not to save a fuel type twice if it maintains its own list of fuel types. This rule is imposed to remove any unnecessary dependencies on the client code to ensure correctness of operation. The client application must also be aware and compensate for any composite (mixed) fuel types, too.

Member Function Documentation

ICWFGM_FuelMap::AddFuel ( [in] ICWFGM_Fuel fuel,
[in] long  file_index,
[in] long  export_file_index,
[out,retval] unsigned char *  fuel_index 
)

Adds a relationship between a CWFGM fuel and a grid file index, sets 'fuel_index' to the internal index that this FuelMap has assigned to it. This call will increment the COM reference counter associated with 'fuel'.

Parameters
fuelFuel to add.
file_indexIndex for the fuel during grid import operations.
export_file_indexIndex for the fuel during grid export operations. This value is currently unused by this object and is available for any purposes that the client application may have.
fuel_indexReturn value for internal fuel index.
ICWFGM_FuelMap::Clone ( [out] ICWFGM_FuelMap **  newFuelMap)

Creates a new fuel map and places the pointer to the object in 'newFuelMap'. Duplicates all relationships maintained by the object being called in a new FuelMap object. This call differs from 'Copy' in that all fuel types are also duplicated.

Parameters
newFuelMapReceiver pointer for the newly created, cloned fuel map object.
ICWFGM_FuelMap::Copy ( [in] ICWFGM_FuelMap toCopy)

Copy()'s semantics are different from Clone()'s: Copy() only copies the handles to fuel types, it doesn't make copies of the fuel types. If you want a complete standalone copy of everything including copies of the fuel types,then use Clone().

Parameters
toCopyHandle of fuel type.
ICWFGM_FuelMap::FuelAtFileIndex ( [in] long  file_index,
[out] unsigned char *  fuel_index,
[out] long *  export_file_index,
[out,retval] ICWFGM_Fuel **  fuel 
)

Given a grid file index, sets 'fuel_index' to the internal index,'export_file_index' to the export grid file index, and sets 'fuel' to the appropriate CWFGM Fuel interface handle. This call does not adjust the COM reference counters for 'fuel'; if the caller plans on retaining the pointer then it should increment the reference counter.

Parameters
file_indexA grid file index.
fuel_indexReturn value for an internal fuel index.
export_file_indexReturn value for a grid file export index.
fuelReturn value for a CWFGM Fuel interface handle.
ICWFGM_FuelMap::FuelAtIndex ( [in] unsigned char  fuel_index,
[out] long *  file_index,
[out] long *  export_file_index,
[out,retval] ICWFGM_Fuel **  fuel 
)

Given an internal fuel index, sets 'file_index' to the grid file import index, 'export_file_index' to the grid file export index, and sets 'fuel' to the appropriate CWFGM Fuel interface handle. This call does not adjust the COM reference counters for 'fuel'; if the caller plans on retaining the pointer then it should increment the reference counter.

Parameters
fuel_indexInternal fuel index.
file_indexReturn value for a grid file import index.
export_file_indexReturn value for a grid file export index.
fuelReturn value for a CWFGM Fuel interface handle.
ICWFGM_FuelMap::GetAttribute ( [in] unsigned short  option,
[out, retval] VARIANT *  value 
)

Polymorphic. This routine retrieves an attribute/option value given the attribute/option index.

Parameters
optionCurrently the only valid attribute/option index supported is CWFGM_ATTRIBUTE_LOAD_WARNING.
valueReturn value for the attribute/option index.
ICWFGM_FuelMap::GetAvailableFileIndex ( [out] long *  index)

Returns an available file index. The logic is as follows: ignore (-9999) while searching all fuel mappings for the minimum negative import fuel index value. If no negative indicies exist, then return -2. Otherwise, return 1 less than the minimum found value.

Parameters
indexReturn value for a file index.
ICWFGM_FuelMap::GetFuelCount ( [out] unsigned char *  count,
[out,retval] unsigned char *  unique_count 
)

Sets 'count' to the number of fuel relationships currently in this FuelMap. Sets 'unique_count' to the number of fuels in this FuelMap.

Parameters
countReturn value for number of fuel relationships.
unique_countReturn value for number of fuels.
ICWFGM_FuelMap::IndexOfFuel ( [in] ICWFGM_Fuel fuel,
[out] long *  file_index,
[out] long *  export_file_index,
[in,out] unsigned char *  fuel_index 
)

Given a fuel interface, sets 'file_index' to the grid file import index, 'export_file_index' to the grid file export index, and sets 'fuel_index' to the internal index. This method can be called repeatedly to iterate through all relationships for a given fuel. The first call to this method should place (UCHAR)-1 into 'fuel_index' (always). Subsequent calls should use the previously returned 'fuel_index' value.

Parameters
fuelA CWFGM Fuel interface handle.
file_indexReturn value for a grid file import index.
export_file_indexReturn value for a grid file export index.
fuel_indexReturn value for an internal fuel index.
ICWFGM_FuelMap::MT_Lock ( [in] unsigned short  exclusive,
[in] unsigned short  obtain 
)

Changes the state of the object with respect to access rights. When the object is used by an active simulation, it must not be modified. When the object is somehow modified, it must be done so in an atomic action to prevent concerns with arising from multithreading. Note that these locks are primarily needed to ensure a simulation dependency is not changed while it occurs. Locking request is forwarded to each attached ICWFGM_Fuel object.

In the event of an error, then locking is undone to reflect an error state.

Parameters
exclusiveTRUE if the requester wants a write lock, false for read/shared access
obtainTRUE to obtain the lock, FALSE to release the lock. If this is FALSE, then the 'exclusive' parameter must match the initial call used to obtain the lock.
See Also
ICWFGM_Fuel::MT_Lock
ICWFGM_FuelMap::RemoveFuel ( [in] ICWFGM_Fuel fuel)

Removes a given CWFGM fuel from this FuelMap. Removes all mappings related to this fuel object. This call will decrement the COM reference counter associated with 'fuel' for each index that is assigned to the fuel.

Parameters
fuelFuel to remove.
ICWFGM_FuelMap::RemoveFuelIndex ( [in] ICWFGM_Fuel fuel,
[in] long  file_index 
)

Removes the association between the file index for a given fuel. The call will also decrement the COM reference counter associated with the fuel, which will conditionally trigger deletion of the fuel.

Parameters
fuelFuel to remove relationship for.
file_indexFile index to remove relationship for.
ICWFGM_FuelMap::SetAttribute ( [in] unsigned short  option,
[in] VARIANT  value 
)

Sets the value for the attribute denoted by "option".

Parameters
optionThe attribute to change.
valueThe value to set the attribute to.

Property Documentation

Property ICWFGM_FuelMap::UserData
getsetproperty

This property is unused by this object, and is available for exclusive use by the client code. It is a VARIANT value to ensure that the client code can store a pointer value (if it chooses) for use in manual subclassing this object. This value is not loaded or saved during serialization operations, and it is the responsibility of the client code to manage any value or object stored here. Access to this property is not thread-safe.

Parameters
pValvalue of UserData
newValreplacement value for UserData