Class CCWFGM WeatherStation. More...
#include <CWFGM_WeatherStation.h>
Public Member Functions | |
STDMETHOD() | Clone (ICWFGM_WeatherStation **newWeatherStation) |
STDMETHOD() | MT_Lock (USHORT exclusive, USHORT obtain) |
STDMETHOD() | GetStreamCount (ULONG *count) |
STDMETHOD() | AddStream (ICWFGM_WeatherStream *stream, ULONG index) |
STDMETHOD() | RemoveStream (ICWFGM_WeatherStream *stream) |
STDMETHOD() | StreamAtIndex (ULONG index, ICWFGM_WeatherStream **stream) |
STDMETHOD() | IndexOfStream (ICWFGM_WeatherStream *stream, ULONG *index) |
STDMETHOD() | GetAttribute (USHORT option, VARIANT *value) |
STDMETHOD() | SetAttribute (USHORT option, VARIANT value) |
STDMETHOD() | get_UserData (VARIANT *pVal) |
STDMETHOD() | put_UserData (VARIANT newVal) |
Public Member Functions inherited from ICWFGM_WeatherStation | |
HRESULT | MT_Lock ([in] unsigned short exclusive, [in] unsigned short obtain) |
HRESULT | Clone ([out]ICWFGM_WeatherStation **newWeatherStation) |
HRESULT | GetStreamCount ([out, retval]unsigned long *count) |
HRESULT | AddStream ([in]ICWFGM_WeatherStream *stream, [in]unsigned long index) |
HRESULT | RemoveStream ([in]ICWFGM_WeatherStream *stream) |
HRESULT | StreamAtIndex ([in]unsigned long index, [out, retval]ICWFGM_WeatherStream **stream) |
HRESULT | IndexOfStream ([in]ICWFGM_WeatherStream *stream, [out, retval]unsigned long *index) |
HRESULT | GetAttribute ([in]unsigned short option, [out, retval] VARIANT *value) |
HRESULT | SetAttribute ([in]unsigned short option, [in] VARIANT value) |
Additional Inherited Members | |
Properties inherited from ICWFGM_WeatherStation | |
VARIANT | UserData [get, set] |
Class CCWFGM WeatherStation.
This object maintains a collection of weather streams. A variety of streams may co-exist to provide a useful comparison of results in different scenarios. It also supports the standard COM IPersistStream, IPersistStreamInit, and IPersistStorage interfaces. Any weather stream is automatically saved with the station in order to simplify serialization operations in the client application.
A weather stream must be associated with a station before being attached to a scenario.
CCWFGM_WeatherStation::AddStream | ( | ICWFGM_WeatherStream * | stream, |
ULONG | index | ||
) |
Adds a weather stream to this weather station. This stream may be in any state (initialized, newly created, or containing data). Any calculated data in the weather stream will be marked invalid to use the location and time zone of this weather station.
stream | A weather stream object. |
index | Index (0-based) for where to insert the stream into the set. |
S_OK | Successful. |
E_OUTOFMEMORY | |
Insufficient | memory. |
E_NOINTERFACE | The object trying to be added (stream) doesn't support the correct interfaces, or if the pointer is invalid. |
ERROR_WEATHER_STREAM_ALREADY_ADDED | If the stream being added is already associated with this station. |
ERROR_WEATHER_STREAM_ALREADY_ASSIGNED | The stream is already attached to a weather station (a stream can only be associated with a single weather station at a time). |
ERROR_WEATHER_STREAM_UNKNOWN | The weather stream indexed could not be found. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot add stream while the simulation is running. |
CCWFGM_WeatherStation::Clone | ( | ICWFGM_WeatherStation ** | newWeatherStation | ) |
Creates a new weather station with all the same properties of the object being called, returns a handle to the new object in 'newWeatherStation'. Any weather streams associated with this object are also duplicated for the new station.
newWeatherStation | A weather station object. |
S_OK | Successful. |
E_POINTER | The address provided for newWeatherStation is invalid. |
E_OUTOFMEMORY | Insufficient memory. |
ERROR_SEVERITY_WARNING | File error or an unspecified failure. |
E_NOINTERFACE | Correct interface is not supported. |
CCWFGM_WeatherStation::get_UserData | ( | VARIANT * | pVal | ) |
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.
pVal | Value of UserData |
E_POINTER | The address provided for pVal is invalid |
S_OK | Successful |
CCWFGM_WeatherStation::GetAttribute | ( | USHORT | option, |
VARIANT * | value | ||
) |
Gets the value of an "option" and saves it in the "value" variable provided.
option | The option that you want the value of (Longitude, Latitude or Elevation). Valid values are:
|
value | A pointer to a variable that you want the value to be saved in. |
E_POINTER | The address provided for value is invalid. |
S_OK | Successful. |
E_INVALIDARG | Invalid arguments were passed. |
CCWFGM_WeatherStation::GetStreamCount | ( | ULONG * | count | ) |
Returns the number of streams associated with this weather station. Any number of streams can be associated with a given weather station and be assigned different values, options, and time ranges. However, only one stream from a station can be associated with a scenario at a given time.
count | Number of streams. |
E_POINTER | The address provided for count is invalid. |
S_OK | Successful. |
CCWFGM_WeatherStation::IndexOfStream | ( | ICWFGM_WeatherStream * | stream, |
ULONG * | index | ||
) |
Returns the index of 'stream' in this station's set of streams.
stream | A weather stream object. |
index | The index of stream. |
E_POINTER | The address provided for stream or index is invalid. |
S_OK | Successful. |
ERROR_WEATHER_STREAM_UNKNOWN | Stream is unknown to this weather station. |
CCWFGM_WeatherStation::MT_Lock | ( | USHORT | exclusive, |
USHORT | 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 that data contributing during a simulation is not modified while the simulation is executing.
All routines in the ICWFGM_GridEngine interface are necessarily NOT multithreading safe (for performance) but other interfaces for a given COM object implementing this interface must be by specification.
In the event of an error, then locking is undone to reflect an error state.
exclusive | TRUE if the requester wants a write lock, false for read/shared access |
obtain | TRUE 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. |
SUCCESS_STATE_OBJECT_UNLOCKED | Lock was released. |
SUCCESS_STATE_OBJECT_LOCKED_WRITE | Exclusive/write lock obtained. |
SUCCESS_STATE_OBJECT_LOCKED_SCENARIO | A scenario successfully required a lock for purposes of simulating. |
SUCCESS_STATE_OBJECT_LOCKED_READ | Shared/read lock obtained. |
S_OK | Successful |
CCWFGM_WeatherStation::put_UserData | ( | VARIANT | newVal | ) |
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.
newVal | Replacement value for UserData |
S_OK | Successful |
CCWFGM_WeatherStation::RemoveStream | ( | ICWFGM_WeatherStream * | stream | ) |
Removes an association between a weather stream and this weather station.
stream | A weather stream object. |
E_POINTER | The address provided for stream is invalid. |
S_OK | Successful. |
ERROR_WEATHER_STREAM_UNKNOWN | The client program tried to remove a stream object that is unknown to this station object. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot remove a stream while it is used in a running scenario. |
CCWFGM_WeatherStation::SetAttribute | ( | USHORT | option, |
VARIANT | value | ||
) |
Sets the value of an "option" to the value of the "value" variable provided.
option | The option that you want the value of (Longitude, Latitude or Default Elevation). Valid values are:
|
value | The new value for the "option" |
E_POINTER | The address provided for value is invalid. |
S_OK | Successful. |
E_INVALIDARG | Invalid arguments were passed. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot change attributes while a scenario is running. |
E_FAIL | Failed. |
CCWFGM_WeatherStation::StreamAtIndex | ( | ULONG | index, |
ICWFGM_WeatherStream ** | stream | ||
) |
Given an index value, returns a pointer to a specific stream associated with this station.
index | Index to a weather stream |
stream | Address to contain the specific requested weather stream. |
E_POINTER | The address provided for stream is invalid. |
S_OK | Successful. |
ERROR_WEATHER_STREAM_UNKNOWN | The index is out of range. |