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

Creates, updates and handles the column properties. More...

#include <WColumnPropertyHandler.h>

+ Collaboration diagram for WColumnPropertyHandler:

Public Types

typedef std::tuple< std::string, std::string, std::string, std::list< std::string > > NameDescriptionSearchTyp
 tuple with 3 string as value More...
 
typedef boost::function< void() > CallbackPtr
 Function variables for updating the data. More...
 
typedef std::shared_ptr< WColumnPropertyHandlerSPtr
 shared_ptr that points to itself More...
 

Public Member Functions

 WColumnPropertyHandler (WProtonData::SPtr protonData, WPropertyGroup::SPtr properties, WColumnPropertyHandler::CallbackPtr dataUpdate)
 constructor More...
 
void createProperties ()
 creates the group property and the subproperty
More...
 
void updateProperty ()
 update current group property and subproperty More...
 
void setSelectionEventMethod (WColumnPropertyHandler::CallbackPtr externEventMethod)
 setter to use a external function More...
 

Private Types

typedef WItemSelectionItemTyped< std::string > ItemType
 represents the item type for item-selection More...
 
typedef std::map< WPropSelection, std::string >::iterator PropMapEntry
 Reresents an entry in a < WPropSelection, string > map. More...
 

Private Member Functions

WPropSelection addHeaderProperty (WColumnPropertyHandler::NameDescriptionSearchTyp ndst, WPropertyBase::PropertyChangeNotifierType notifier)
 Creates the individual WItemSelection. More...
 
void propertyNotifier (WPropertyBase::SPtr property)
 Event function when WItemSelection is triggered. More...
 
std::shared_ptr< WItemSelectioninitializeSelectionItem (std::list< std::string > typeName)
 creates the content (options) of the WItemSelection More...
 
int getFilterIndex (int index, std::list< std::string > typeName)
 converts the index to the filtered index
More...
 

Private Attributes

std::map< WPropSelection, std::string > mapPropSelectionsToString
 A map between WPropSelection items and column names as strings. More...
 
WProtonData::SPtr m_protonData
 Pointer to the content and header of the CSV. More...
 
WPropertyGroup::SPtr m_properties
 A property variable that is generated by the WModul. More...
 
WColumnPropertyHandler::CallbackPtr m_dataUpdate
 A function variable that reinitializes the WDataSets. More...
 
WColumnPropertyHandler::CallbackPtr m_externEventMethod
 A void function variable that can be use outside. More...
 
WPropGroup m_columnSelectionGroup
 Property group for column selection. More...
 

Detailed Description

Creates, updates and handles the column properties.

Definition at line 47 of file WColumnPropertyHandler.h.

Member Typedef Documentation

◆ CallbackPtr

typedef boost::function< void( ) > WColumnPropertyHandler::CallbackPtr

Function variables for updating the data.

Definition at line 61 of file WColumnPropertyHandler.h.

◆ ItemType

represents the item type for item-selection

Definition at line 144 of file WColumnPropertyHandler.h.

◆ NameDescriptionSearchTyp

typedef std::tuple< std::string, std::string, std::string, std::list< std::string > > WColumnPropertyHandler::NameDescriptionSearchTyp

tuple with 3 string as value

  1. Name of single-selector,
  2. Desciption of single-selector,
  3. Value that is searched for in the csv header

Definition at line 56 of file WColumnPropertyHandler.h.

◆ PropMapEntry

typedef std::map< WPropSelection, std::string >::iterator WColumnPropertyHandler::PropMapEntry
private

Reresents an entry in a < WPropSelection, string > map.

Definition at line 149 of file WColumnPropertyHandler.h.

◆ SPtr

shared_ptr that points to itself

Definition at line 66 of file WColumnPropertyHandler.h.

Constructor & Destructor Documentation

◆ WColumnPropertyHandler()

WColumnPropertyHandler::WColumnPropertyHandler ( WProtonData::SPtr  protonData,
WPropertyGroup::SPtr  properties,
WColumnPropertyHandler::CallbackPtr  dataUpdate 
)
explicit

constructor

Parameters
protonDataPointer to the content and header of the CSV
propertiesA property variable that is generated by the WModul
dataUpdateA function variable that reinitializes the WDataSets

Definition at line 33 of file WColumnPropertyHandler.cpp.

References mapPropSelectionsToString.

Member Function Documentation

◆ addHeaderProperty()

WPropSelection WColumnPropertyHandler::addHeaderProperty ( WColumnPropertyHandler::NameDescriptionSearchTyp  ndst,
WPropertyBase::PropertyChangeNotifierType  notifier 
)
private

Creates the individual WItemSelection.

Parameters
ndst( n = Name, d = Description, s = Search, t = Typ )
notifierThe notifier for the property
Returns
WPropSelection The created selection

Definition at line 108 of file WColumnPropertyHandler.cpp.

References WPropertyHelper::PC_SELECTONLYONE::addTo(), WPropertyHelper::PC_NOTEMPTY::addTo(), getFilterIndex(), initializeSelectionItem(), m_columnSelectionGroup, and m_protonData.

Referenced by createProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createProperties()

void WColumnPropertyHandler::createProperties ( )

creates the group property and the subproperty

Definition at line 43 of file WColumnPropertyHandler.cpp.

References addHeaderProperty(), WSingleSelectorName::getListOfSelectorContent(), m_columnSelectionGroup, m_properties, mapPropSelectionsToString, and propertyNotifier().

+ Here is the call graph for this function:

◆ getFilterIndex()

int WColumnPropertyHandler::getFilterIndex ( int  index,
std::list< std::string >  typeName 
)
private

converts the index to the filtered index

Parameters
indexindex to search.
typeNameList of column types.
Returns
filterd index

Definition at line 86 of file WColumnPropertyHandler.cpp.

References m_protonData.

Referenced by addHeaderProperty().

+ Here is the caller graph for this function:

◆ initializeSelectionItem()

std::shared_ptr< WItemSelection > WColumnPropertyHandler::initializeSelectionItem ( std::list< std::string >  typeName)
private

creates the content (options) of the WItemSelection

Parameters
typeNameType of column.
Returns
content of WItemSelection

Definition at line 70 of file WColumnPropertyHandler.cpp.

References WItemSelectionItemTyped< T >::create(), and m_protonData.

Referenced by addHeaderProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ propertyNotifier()

void WColumnPropertyHandler::propertyNotifier ( WPropertyBase::SPtr  property)
private

Event function when WItemSelection is triggered.

Parameters
propertyThe changed property

Definition at line 139 of file WColumnPropertyHandler.cpp.

References WItemSelector::at(), m_dataUpdate, m_externEventMethod, m_protonData, and mapPropSelectionsToString.

Referenced by createProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSelectionEventMethod()

void WColumnPropertyHandler::setSelectionEventMethod ( WColumnPropertyHandler::CallbackPtr  externEventMethod)

setter to use a external function

Parameters
externEventMethodA void function variable that can be use outside

Definition at line 61 of file WColumnPropertyHandler.cpp.

References m_externEventMethod.

◆ updateProperty()

void WColumnPropertyHandler::updateProperty ( )

update current group property and subproperty

Definition at line 66 of file WColumnPropertyHandler.cpp.

Member Data Documentation

◆ m_columnSelectionGroup

WPropGroup WColumnPropertyHandler::m_columnSelectionGroup
private

Property group for column selection.

Definition at line 139 of file WColumnPropertyHandler.h.

Referenced by addHeaderProperty(), and createProperties().

◆ m_dataUpdate

WColumnPropertyHandler::CallbackPtr WColumnPropertyHandler::m_dataUpdate
private

A function variable that reinitializes the WDataSets.

Definition at line 114 of file WColumnPropertyHandler.h.

Referenced by propertyNotifier().

◆ m_externEventMethod

WColumnPropertyHandler::CallbackPtr WColumnPropertyHandler::m_externEventMethod
private

A void function variable that can be use outside.

Definition at line 119 of file WColumnPropertyHandler.h.

Referenced by propertyNotifier(), and setSelectionEventMethod().

◆ m_properties

WPropertyGroup::SPtr WColumnPropertyHandler::m_properties
private

A property variable that is generated by the WModul.

Definition at line 109 of file WColumnPropertyHandler.h.

Referenced by createProperties().

◆ m_protonData

WProtonData::SPtr WColumnPropertyHandler::m_protonData
private

Pointer to the content and header of the CSV.

Definition at line 104 of file WColumnPropertyHandler.h.

Referenced by addHeaderProperty(), getFilterIndex(), initializeSelectionItem(), and propertyNotifier().

◆ mapPropSelectionsToString

std::map< WPropSelection, std::string > WColumnPropertyHandler::mapPropSelectionsToString
private

A map between WPropSelection items and column names as strings.

Definition at line 99 of file WColumnPropertyHandler.h.

Referenced by createProperties(), propertyNotifier(), and WColumnPropertyHandler().


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