OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
WDataSetCSV Class Reference

Represents a CSV dataset. More...

#include <WDataSetCSV.h>

+ Inheritance diagram for WDataSetCSV:
+ Collaboration diagram for WDataSetCSV:

Public Types

typedef std::vector< std::vector< std::string > > Content
 represents a vector containing a vector of strings. More...
 
typedef std::shared_ptr< std::vector< std::vector< std::string > > > ContentSPtr
 represents a pointer to the Content More...
 
typedef std::shared_ptr< std::vector< std::string > > SeperatedRowSPtr
 represents a pointer to a vector of csv-raw-row as string More...
 
typedef std::vector< std::string > ContentElem
 represents an element within WDataSetCSV object. More...
 
typedef std::shared_ptr< std::vector< std::string > > ContentElemSPtr
 represents a shared pointer to a ContentElem object. More...
 
- Public Types inherited from WDataSet
typedef std::shared_ptr< WDataSetSPtr
 Shared pointer abbreviation to a instance of this class. More...
 
typedef std::shared_ptr< const WDataSetConstSPtr
 Shared pointer abbreviation to a const instance of this class. More...
 

Public Member Functions

 WDataSetCSV (WDataSetCSV::ContentSPtr header, WDataSetCSV::ContentSPtr data)
 Construct WDataSetCSV object. More...
 
 WDataSetCSV ()
 The standard constructor. More...
 
virtual ~WDataSetCSV ()
 Destructs this dataset. More...
 
WDataSetCSV::ContentSPtr getHeader ()
 Getter method to receive csv header. More...
 
WDataSetCSV::ContentSPtr getData ()
 Getter method to receive csv data. More...
 
void setRawDataSet (WDataSetCSV::SeperatedRowSPtr rawDataSetIn)
 Getter method to receive csv rawdata. More...
 
SeperatedRowSPtr getRawDataSet ()
 Getter method to receive csv data. More...
 
- Public Member Functions inherited from WDataSet
 WDataSet ()
 This constructor should be used if a dataSet does not stem from a file. More...
 
virtual ~WDataSet ()
 Since WDataSet is a base class and thus should be polymorphic we add virtual destructor. More...
 
void setFilename (const std::string filename)
 Set the name of the file that this data set stems from. More...
 
std::string getFilename () const
 Get the name of the file that this data set stems from. More...
 
OW_API_DEPRECATED void setFileName (const std::string filename)
 Set the name of the file that this data set stems from. More...
 
OW_API_DEPRECATED std::string getFileName () const
 Get the name of the file that this data set stems from. More...
 
virtual bool isTexture () const
 Determines whether this dataset can be used as a texture. More...
 
virtual std::shared_ptr< WDataSetVectorisVectorDataSet ()
 Checks if this dataset is a vector dataset. More...
 
virtual osg::ref_ptr< WDataTexture3DgetTexture () const
 Returns the texture- representation of the dataset. More...
 
virtual const std::string getName () const
 Gets the name of this prototype. More...
 
virtual const std::string getDescription () const
 Gets the description for this prototype. More...
 
std::shared_ptr< WPropertiesgetProperties () const
 Return a pointer to the properties object of the dataset. More...
 
std::shared_ptr< WPropertiesgetInformationProperties () const
 Return a pointer to the information properties object of the dataset. More...
 
- Public Member Functions inherited from WTransferable
 WTransferable ()
 Default constructor. More...
 
virtual ~WTransferable ()
 Destructor. More...
 
- Public Member Functions inherited from WPrototyped
 WPrototyped ()
 Default constructor. More...
 
virtual ~WPrototyped ()
 Destructor. More...
 
template<typename T >
bool isA ()
 Checks whether the actual prototype has the specified runtime type. More...
 

Private Attributes

WDataSetCSV::ContentSPtr m_header
 Stores the column titles of a loaded CSV file. More...
 
WDataSetCSV::ContentSPtr m_data
 Stores the data of a loaded CSV file. More...
 
SeperatedRowSPtr rawDataSet
 Stores the rawdata of a loaded CSV file. More...
 

Friends

class WDataSetCSVTest
 Only test class may be friend. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from WDataSet
static std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 
- Protected Attributes inherited from WDataSet
std::shared_ptr< WPropertiesm_properties
 The property object for the dataset. More...
 
std::shared_ptr< WPropertiesm_infoProperties
 The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". More...
 
- Static Protected Attributes inherited from WDataSet
static std::shared_ptr< WPrototypedm_prototype = std::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 

Detailed Description

Represents a CSV dataset.

Definition at line 37 of file WDataSetCSV.h.

Member Typedef Documentation

◆ Content

typedef std::vector< std::vector< std::string > > WDataSetCSV::Content

represents a vector containing a vector of strings.

Definition at line 47 of file WDataSetCSV.h.

◆ ContentElem

typedef std::vector< std::string > WDataSetCSV::ContentElem

represents an element within WDataSetCSV object.

Definition at line 62 of file WDataSetCSV.h.

◆ ContentElemSPtr

typedef std::shared_ptr< std::vector< std::string > > WDataSetCSV::ContentElemSPtr

represents a shared pointer to a ContentElem object.

Definition at line 67 of file WDataSetCSV.h.

◆ ContentSPtr

typedef std::shared_ptr< std::vector< std::vector< std::string > > > WDataSetCSV::ContentSPtr

represents a pointer to the Content

Definition at line 52 of file WDataSetCSV.h.

◆ SeperatedRowSPtr

typedef std::shared_ptr< std::vector< std:: string > > WDataSetCSV::SeperatedRowSPtr

represents a pointer to a vector of csv-raw-row as string

Definition at line 57 of file WDataSetCSV.h.

Constructor & Destructor Documentation

◆ WDataSetCSV() [1/2]

WDataSetCSV::WDataSetCSV ( WDataSetCSV::ContentSPtr  header,
WDataSetCSV::ContentSPtr  data 
)
explicit

Construct WDataSetCSV object.

Parameters
headerColumn names of the CSV file.
dataData content of the CSV file.

Definition at line 28 of file WDataSetCSV.cpp.

◆ WDataSetCSV() [2/2]

WDataSetCSV::WDataSetCSV ( )

The standard constructor.

Definition at line 33 of file WDataSetCSV.cpp.

◆ ~WDataSetCSV()

WDataSetCSV::~WDataSetCSV ( )
virtual

Destructs this dataset.

Definition at line 37 of file WDataSetCSV.cpp.

Member Function Documentation

◆ getData()

WDataSetCSV::ContentSPtr WDataSetCSV::getData ( )

Getter method to receive csv data.

Returns
m_data as WDataSetCSV::Content object

Definition at line 46 of file WDataSetCSV.cpp.

References m_data.

Referenced by WDataSetCSVTest::testGetData().

+ Here is the caller graph for this function:

◆ getHeader()

WDataSetCSV::ContentSPtr WDataSetCSV::getHeader ( )

Getter method to receive csv header.

Returns
m_header as WDataSetCSV::Content object

Definition at line 41 of file WDataSetCSV.cpp.

References m_header.

Referenced by WDataSetCSVTest::testGetHeader().

+ Here is the caller graph for this function:

◆ getRawDataSet()

WDataSetCSV::SeperatedRowSPtr WDataSetCSV::getRawDataSet ( )

Getter method to receive csv data.

Returns
rawDataSet as std::vector< std:: string > object

Definition at line 51 of file WDataSetCSV.cpp.

References rawDataSet.

◆ setRawDataSet()

void WDataSetCSV::setRawDataSet ( WDataSetCSV::SeperatedRowSPtr  rawDataSetIn)

Getter method to receive csv rawdata.

Parameters
rawDataSetInas WDataSetCSV::SeperatedRowSPtr object

Definition at line 56 of file WDataSetCSV.cpp.

References rawDataSet.

Friends And Related Function Documentation

◆ WDataSetCSVTest

friend class WDataSetCSVTest
friend

Only test class may be friend.

Definition at line 42 of file WDataSetCSV.h.

Member Data Documentation

◆ m_data

WDataSetCSV::ContentSPtr WDataSetCSV::m_data
private

Stores the data of a loaded CSV file.

Definition at line 124 of file WDataSetCSV.h.

Referenced by getData().

◆ m_header

WDataSetCSV::ContentSPtr WDataSetCSV::m_header
private

Stores the column titles of a loaded CSV file.

Definition at line 119 of file WDataSetCSV.h.

Referenced by getHeader().

◆ rawDataSet

SeperatedRowSPtr WDataSetCSV::rawDataSet
private

Stores the rawdata of a loaded CSV file.

Definition at line 129 of file WDataSetCSV.h.

Referenced by getRawDataSet(), and setRawDataSet().


The documentation for this class was generated from the following files: