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

Interface ICWFGM WeatherStation. More...

import "WeatherCOM.idl";

Collaboration diagram for ICWFGM_WeatherStation:
Collaboration graph

Public Member Functions

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)
 

Properties

VARIANT UserData [get, set]
 

Detailed Description

Interface ICWFGM 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.

Member Function Documentation

ICWFGM_WeatherStation::AddStream ( [in] ICWFGM_WeatherStream *  stream,
[in] unsigned long  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.

Parameters
streamA weather stream object.
indexIndex (0-based) for where to insert the stream into the set.
ICWFGM_WeatherStation::Clone ( [out] 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.

Parameters
newWeatherStationA weather station object.
ICWFGM_WeatherStation::GetAttribute ( [in] unsigned short  option,
[out, retval] VARIANT *  value 
)

Gets the value of an "option" and saves it in the "value" variable provided.

Parameters
optionThe option that you want the value of (Longitude, Latitude or Elevation). Valid values are:
  • CWFGM_GRID_ATTRIBUTE_LATITUDE 64-bit floating point, radians.
  • CWFGM_GRID_ATTRIBUTE_LONGITUDE 64-bit floating point, radians.
  • CWFGM_GRID_ATTRIBUTE_DEFAULT_ELEVATION 64-bit floating point, metres. User specified elevation to use when there is no grid elevation available for at a requested grid location.
  • CWFGM_ATTRIBUTE_LOAD_WARNING BSTR. Any warnings generated by the COM object when deserializating.
valueA pointer to a variable that you want the value to be saved in.
ICWFGM_WeatherStation::GetStreamCount ( [out, retval] unsigned long *  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.

Parameters
countNumber of streams.
ICWFGM_WeatherStation::IndexOfStream ( [in] ICWFGM_WeatherStream *  stream,
[out, retval] unsigned long *  index 
)

Returns the index of 'stream' in this station's set of streams.

Parameters
streamA weather stream object.
indexThe index of stream.
ICWFGM_WeatherStation::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. All routines are otherwise multi-thread safe.

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.
ICWFGM_WeatherStation::RemoveStream ( [in] ICWFGM_WeatherStream *  stream)

Removes an association between a weather stream and this weather station.

Parameters
streamA weather stream object.
ICWFGM_WeatherStation::SetAttribute ( [in] unsigned short  option,
[in] VARIANT  value 
)

Sets the value of an "option" to the value of the "value" variable provided.

Parameters
optionThe option that you want the value of (Longitude, Latitude or Default Elevation). Valid values are:
  • CWFGM_GRID_ATTRIBUTE_LATITUDE 64-bit floating point, radians.
  • CWFGM_GRID_ATTRIBUTE_LONGITUDE 64-bit floating point, radians.
  • CWFGM_GRID_ATTRIBUTE_DEFAULT_ELEVATION 64-bit floating point, metres. User specified elevation to use when there is no grid elevation available for at a requested grid location.
valueThe new value for the "option"
ICWFGM_WeatherStation::StreamAtIndex ( [in] unsigned long  index,
[out,retval] ICWFGM_WeatherStream **  stream 
)

Given an index value, returns a pointer to a specific stream associated with this station.

Parameters
indexIndex to a weather stream
streamAddress to contain the specific requested weather stream.

Property Documentation

Property ICWFGM_WeatherStation::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.