Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::Streams Class Reference

Last update: 10.07.2023

Defines an open, ready-to-use, data sources. More...

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::Streams:
ansys::dpf::DpfTypes

Public Member Functions

 Streams (DataSources const &dataSources)
 
 Streams (Streams const &)
 
 Streams (Streams &&)
 
 Streams (int id, Client const *const client)
 
Streamsoperator= (Streams const &)
 
Streamsoperator= (Streams &&)
 
void releaseFiles ()
 
void addStream (ExternalStream *stream)
 
void addStream (ExternalStream *stream, LabelSpace const &identifier)
 
template<typename ExternalStreamType >
ExternalStreamType *const getExternalStream (std::string const &key) const
 
template<typename ExternalStreamType >
ExternalStreamType *const getExternalStream (LabelSpace const &identifier) const
 
DataSources dataSources () const
 
- Public Member Functions inherited from ansys::dpf::DpfTypes
virtual bool empty () const
 
virtual std::string describe () const
 
so::API const * callAPI () const
 
bool isOnCommonAPI () const
 
bool getClient (Client &client) const
 
bool hasBeenMovedLocally () const
 
bool isSameObject (DpfTypes const &rhs) const
 

Static Public Member Functions

static Streams emptyStreams ()
 

Detailed Description

Defines an open, ready-to-use, data sources.

Streams is an entity containing the data sources. Once the files in the streams are opened, they stay opened and they keep some data in cache to make the next evaluations faster. To close the files, release the streams.

Constructor & Destructor Documentation

◆ Streams() [1/2]

ansys::dpf::Streams::Streams ( DataSources const &  dataSources)

Create a stream from given data sources.

Parameters
[in]dataSourcesData source from which to create stream.

◆ Streams() [2/2]

ansys::dpf::Streams::Streams ( int  id,
Client const *const  client 
)

Retrieve an existing instance of Streams on a server.

Parameters
[in]idId of the Streams on the server's database.
[in]clientClient instance designating the IP, port and protocol to use.

Member Function Documentation

◆ addStream() [1/2]

void ansys::dpf::Streams::addStream ( ExternalStream stream)

Add external stream.

Parameters
[in]streamExternal stream to add.

◆ addStream() [2/2]

void ansys::dpf::Streams::addStream ( ExternalStream stream,
LabelSpace const &  identifier 
)

Add external stream.

Parameters
[in]streamExternal stream to add.
[in]identifierIdentifier returned by the data sources.

◆ emptyStreams()

static Streams ansys::dpf::Streams::emptyStreams ( )
static

Create an empty streams.

Returns
Empty Streams.

◆ getExternalStream()

template<typename ExternalStreamType >
ExternalStreamType *const ansys::dpf::Streams::getExternalStream ( LabelSpace const &  identifier) const
Parameters
[in]identifierIdentifier returned by the data sources.

◆ releaseFiles()

void ansys::dpf::Streams::releaseFiles ( )

Closes all files and releases file resources.