Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::StringField Class Reference

Last update: 10.07.2023

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::StringField:
ansys::dpf::DpfTypes

Public Member Functions

 StringField (Client const *const client, dp_int number_of_entities=0, dp_int data_size=0)
 
 StringField (dp_int number_of_entities=0, dp_int data_size=0)
 
 StringField (StringField const &)
 
 StringField (StringField &&)
 
StringFieldoperator= (StringField const &)
 
StringFieldoperator= (StringField &&)
 
Location location () const
 
Scoping scoping () const
 
dp_int dataSize () const
 
void push_back (dp_id entity_id, std::vector< std::string > const &values)
 
void setData (std::vector< std::string > const &data)
 
void setScoping (ansys::dpf::Scoping &s)
 
DpfVector< std::string > data () const
 
void getData (std::vector< std::string > &values_to_fill) const
 
void entityData (dp_index entity_index, DpfVector< std::string > &data) const
 
void entityDataById (dp_id entity_id, DpfVector< std::string > &data) const
 
void reserve (dp_int number_of_entities, dp_int overall_size=0)
 
void resize (dp_int number_of_entities, dp_int overall_size)
 
- 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 StringField emptyStringField ()
 

Detailed Description

Holds string data describing a Property located on given entities (the StringField's data is bounded with its scoping). Is the equivalent of the Field but with string values data (and not double values).

Constructor & Destructor Documentation

◆ StringField() [1/2]

ansys::dpf::StringField::StringField ( Client const *const  client,
dp_int  number_of_entities = 0,
dp_int  data_size = 0 
)

Create an empty property field with a client.

Parameters
[in]clientClient to create the property field on.
[in]number_of_entitiesNumber of entities reserved.
[in]data_sizeReserved size of data.

◆ StringField() [2/2]

ansys::dpf::StringField::StringField ( dp_int  number_of_entities = 0,
dp_int  data_size = 0 
)

Create a property with number of entities and data size.

Parameters
[in]number_of_entitiesNumber of entities reserved.
[in]data_sizeReserved size of data.

Member Function Documentation

◆ data()

DpfVector< std::string > ansys::dpf::StringField::data ( ) const
Returns
DpfVector of data array.

◆ dataSize()

dp_int ansys::dpf::StringField::dataSize ( ) const
Returns
Size of the data container.

◆ entityData()

void ansys::dpf::StringField::entityData ( dp_index  entity_index,
DpfVector< std::string > &  data 
) const
Returns
DpfVector of data array of an entity, by index.
Parameters
[in]entity_indexIndex of entity for which to get data.
[out]dataPointer to the data.

◆ entityDataById()

void ansys::dpf::StringField::entityDataById ( dp_id  entity_id,
DpfVector< std::string > &  data 
) const
Returns
DpfVector of data array of an entity, by id.
Parameters
[in]entity_idId of entity for which to get data.
[out]dataPointer to the data.

◆ getData()

void ansys::dpf::StringField::getData ( std::vector< std::string > &  values_to_fill) const

Get all data for property entities.

Parameters
[out]values_to_fillProperty entity data.

◆ location()

Location ansys::dpf::StringField::location ( ) const
Returns
Location of the property.

◆ push_back()

void ansys::dpf::StringField::push_back ( dp_id  entity_id,
std::vector< std::string > const &  values 
)

Push back the entity data.

Parameters
[in]entity_idId of entity for which to push data.
[in]valuesVector of data for entity.

◆ reserve()

void ansys::dpf::StringField::reserve ( dp_int  number_of_entities,
dp_int  overall_size = 0 
)

Reserve the Field. Only implemented for in process udage. To reserve the size for gRPC usage, use the constructor.

Parameters
[in]number_of_entitiesNumber of entities.
[in]overall_sizeTotal size of entity data.

◆ resize()

void ansys::dpf::StringField::resize ( dp_int  number_of_entities,
dp_int  overall_size 
)

Reserve the Field.

Parameters
[in]number_of_entitiesNumber of entities.
[in]overall_sizeTotal size of entity data.

◆ scoping()

Scoping ansys::dpf::StringField::scoping ( ) const
Returns
Scoping of the property.

◆ setData()

void ansys::dpf::StringField::setData ( std::vector< std::string > const &  data)

Set the data of the property field.

Parameters
[in]dataVector of data.

◆ setScoping()

void ansys::dpf::StringField::setScoping ( ansys::dpf::Scoping s)

Set the scoping of the property field.