rds2cpp
C++ library for parsing RDS files
Loading...
Searching...
No Matches
rds2cpp::PairList Struct Reference

Pairlist, i.e., a linked list. More...

#include <RObject.hpp>

Inheritance diagram for rds2cpp::PairList:
Collaboration diagram for rds2cpp::PairList:

Public Member Functions

SEXPType type () const
 
void add (std::string t, std::unique_ptr< RObject > d, StringEncoding enc=StringEncoding::UTF8)
 
void add (std::string t, RObject *d, StringEncoding enc=StringEncoding::UTF8)
 
void add (std::unique_ptr< RObject > d)
 
void add (RObject *d)
 
- Public Member Functions inherited from rds2cpp::RObject

Public Attributes

std::vector< std::unique_ptr< RObject > > data
 
std::vector< unsigned char > has_tag
 
std::vector< std::string > tag_names
 
std::vector< StringEncodingtag_encodings
 
Attributes attributes
 

Detailed Description

Pairlist, i.e., a linked list.

Member Function Documentation

◆ add() [1/4]

void rds2cpp::PairList::add ( RObject * d)
inline

A convenient helper to add an untagged element to the end of the pairlist.

Parameters
dPointer to the element value. This should not be owned by any other resource.

◆ add() [2/4]

void rds2cpp::PairList::add ( std::string t,
RObject * d,
StringEncoding enc = StringEncoding::UTF8 )
inline

A convenient helper to add a tagged element to the end of the pairlist.

Parameters
tTag name.
dPointer to the element value. This should not be owned by any other resource.
encEncoding of the tag name.

◆ add() [3/4]

void rds2cpp::PairList::add ( std::string t,
std::unique_ptr< RObject > d,
StringEncoding enc = StringEncoding::UTF8 )
inline

A convenient helper to add a tagged element to the end of the pairlist.

Parameters
tTag name.
dUnique pointer to the element value.
encEncoding of the tag name.

◆ add() [4/4]

void rds2cpp::PairList::add ( std::unique_ptr< RObject > d)
inline

A convenient helper to add an untagged element to the end of the pairlist.

Parameters
dPointer to the element value.

◆ type()

SEXPType rds2cpp::PairList::type ( ) const
inlinevirtual
Returns
Type of the R object.

Implements rds2cpp::RObject.

Member Data Documentation

◆ attributes

Attributes rds2cpp::PairList::attributes

Additional attributes.

◆ data

std::vector<std::unique_ptr<RObject> > rds2cpp::PairList::data

Contents of the vector.

◆ has_tag

std::vector<unsigned char> rds2cpp::PairList::has_tag

Whether or not the corresponding element of data is tagged. This is of length equal to data.

◆ tag_encodings

std::vector<StringEncoding> rds2cpp::PairList::tag_encodings

Encoding of the tags.

◆ tag_names

std::vector<std::string> rds2cpp::PairList::tag_names

Names of the tags. Empty strings are used for untagged elements.


The documentation for this struct was generated from the following file: