Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEApplicationWindowHelper::FileBucketHandler Class Reference

modul for handling file buckets More...

#include <GNEApplicationWindowHelper.h>

Collaboration diagram for GNEApplicationWindowHelper::FileBucketHandler:
[legend]

Public Member Functions

bool checkFilename (const GNEAttributeCarrier *AC, const std::string &filename) const
 check if the given filename can be assigned to the given AC
 FileBucketHandler (GNEApplicationWindow *applicationWindow, OptionsCont &neteditOptions, OptionsCont &sumoOptions)
 constructor
std::string getConfigDirectory () const
 get current config directory (if we defined a netedit, sumo or netconvert config)
std::string getConfigFilePrefix (const std::string &sufix) const
 get current config patter (if we defined a netedit, sumo or netconvert config)
void registerAC (const GNEAttributeCarrier *AC)
 register AC
void unregisterAC (const GNEAttributeCarrier *AC)
 delete AC
FileBucketupdateAC (const GNEAttributeCarrier *AC, const std::string &filename)
 update filename vinculated with this AC
void updateOptions ()
 update options
 ~FileBucketHandler ()
 destructor
FileBucketgetDefaultBucket (const FileBucket::Type type) const
 functions related with buckets
FileBucketgetBucket (const FileBucket::Type type, const std::string &filename, const bool create)
 get bucket
const std::vector< FileBucket * > & getFileBuckets (const FileBucket::Type type) const
 get vector with all fileBuckets related with the given file type
std::string getDefaultFilename (const FileBucket::Type type) const
 functions related with filenames
std::string getDefaultFolder (const FileBucket::Type type) const
 get default folder associated with the given tipe
void setDefaultFilenameFile (const FileBucket::Type type, const std::string &filename)
 brief set default additional file
bool isFilenameDefined (const FileBucket::Type type) const
 check if at least we have an additional file defined
void resetDefaultFilenames ()
 brief set default files for all buckets

Private Member Functions

 FileBucketHandler (const FileBucketHandler &)=delete
 Invalidated copy constructor.
std::string getPrefix (FileBucket::Type type, const std::vector< std::string > invalidExtensions) const
 get prefix of the given filename
FileBucketHandleroperator= (const FileBucketHandler &)=delete
 Invalidated assignment operator.
std::string parseFilenames (const std::vector< FileBucket::Type > types) const
 parse filenames
void removeEmptyBuckets ()
 removed empty buckets

Private Attributes

GNEApplicationWindowmyApplicationWindow = nullptr
 pointer to application window
std::map< FileBucket::Type, std::vector< FileBucket * > > myBuckets
 map with the buckets
OptionsContmyNeteditOptions
 reference to netedit options
OptionsContmySumoOptions
 reference to sumo options

Detailed Description

modul for handling file buckets

Definition at line 1174 of file GNEApplicationWindowHelper.h.

Constructor & Destructor Documentation

◆ FileBucketHandler() [1/2]

GNEApplicationWindowHelper::FileBucketHandler::FileBucketHandler ( GNEApplicationWindow * applicationWindow,
OptionsCont & neteditOptions,
OptionsCont & sumoOptions )

constructor

Definition at line 2386 of file GNEApplicationWindowHelper.cpp.

References myApplicationWindow, myBuckets, myNeteditOptions, mySumoOptions, FileBucket::prefixes, and FileBucket::types.

Referenced by FileBucketHandler(), and operator=().

Here is the caller graph for this function:

◆ ~FileBucketHandler()

GNEApplicationWindowHelper::FileBucketHandler::~FileBucketHandler ( )

destructor

Definition at line 2401 of file GNEApplicationWindowHelper.cpp.

References myBuckets.

◆ FileBucketHandler() [2/2]

GNEApplicationWindowHelper::FileBucketHandler::FileBucketHandler ( const FileBucketHandler & )
privatedelete

Invalidated copy constructor.

References FileBucketHandler().

Member Function Documentation

◆ checkFilename()

bool GNEApplicationWindowHelper::FileBucketHandler::checkFilename ( const GNEAttributeCarrier * AC,
const std::string & filename ) const

check if the given filename can be assigned to the given AC

Definition at line 2483 of file GNEApplicationWindowHelper.cpp.

References GNEAttributeCarrier::getTagProperty(), GNETagProperties::isFileCompatible(), myBuckets, GNETagProperties::saveInParentFile(), and FileBucket::types.

◆ getBucket()

FileBucket * GNEApplicationWindowHelper::FileBucketHandler::getBucket ( const FileBucket::Type type,
const std::string & filename,
const bool create )

◆ getConfigDirectory()

std::string GNEApplicationWindowHelper::FileBucketHandler::getConfigDirectory ( ) const

get current config directory (if we defined a netedit, sumo or netconvert config)

Definition at line 2505 of file GNEApplicationWindowHelper.cpp.

References getDefaultFolder(), isFilenameDefined(), and FileBucket::prefixes.

◆ getConfigFilePrefix()

std::string GNEApplicationWindowHelper::FileBucketHandler::getConfigFilePrefix ( const std::string & sufix) const

get current config patter (if we defined a netedit, sumo or netconvert config)

Definition at line 2516 of file GNEApplicationWindowHelper.cpp.

References getDefaultFilename(), isFilenameDefined(), and FileBucket::prefixes.

◆ getDefaultBucket()

FileBucket * GNEApplicationWindowHelper::FileBucketHandler::getDefaultBucket ( const FileBucket::Type type) const

functions related with buckets

get default bucket

Definition at line 2527 of file GNEApplicationWindowHelper.cpp.

References myBuckets.

Referenced by getBucket(), and updateAC().

Here is the caller graph for this function:

◆ getDefaultFilename()

std::string GNEApplicationWindowHelper::FileBucketHandler::getDefaultFilename ( const FileBucket::Type type) const

functions related with filenames

get default filename associated with the given tipe

Definition at line 2567 of file GNEApplicationWindowHelper.cpp.

References myBuckets.

Referenced by getBucket(), getConfigFilePrefix(), getDefaultFolder(), and getPrefix().

Here is the caller graph for this function:

◆ getDefaultFolder()

std::string GNEApplicationWindowHelper::FileBucketHandler::getDefaultFolder ( const FileBucket::Type type) const

get default folder associated with the given tipe

Definition at line 2573 of file GNEApplicationWindowHelper.cpp.

References getDefaultFilename().

Referenced by getConfigDirectory().

Here is the caller graph for this function:

◆ getFileBuckets()

const std::vector< FileBucket * > & GNEApplicationWindowHelper::FileBucketHandler::getFileBuckets ( const FileBucket::Type type) const

get vector with all fileBuckets related with the given file type

Definition at line 2561 of file GNEApplicationWindowHelper.cpp.

References myBuckets.

◆ getPrefix()

std::string GNEApplicationWindowHelper::FileBucketHandler::getPrefix ( FileBucket::Type type,
const std::vector< std::string > invalidExtensions ) const
private

get prefix of the given filename

Definition at line 2748 of file GNEApplicationWindowHelper.cpp.

References getDefaultFilename(), and StringUtils::replace().

Referenced by updateOptions().

Here is the caller graph for this function:

◆ isFilenameDefined()

bool GNEApplicationWindowHelper::FileBucketHandler::isFilenameDefined ( const FileBucket::Type type) const

check if at least we have an additional file defined

Definition at line 2601 of file GNEApplicationWindowHelper.cpp.

References myBuckets.

Referenced by getConfigDirectory(), and getConfigFilePrefix().

Here is the caller graph for this function:

◆ operator=()

FileBucketHandler & GNEApplicationWindowHelper::FileBucketHandler::operator= ( const FileBucketHandler & )
privatedelete

Invalidated assignment operator.

References FileBucketHandler().

◆ parseFilenames()

std::string GNEApplicationWindowHelper::FileBucketHandler::parseFilenames ( const std::vector< FileBucket::Type > types) const
private

parse filenames

Definition at line 2711 of file GNEApplicationWindowHelper.cpp.

References myBuckets.

Referenced by updateOptions().

Here is the caller graph for this function:

◆ registerAC()

void GNEApplicationWindowHelper::FileBucketHandler::registerAC ( const GNEAttributeCarrier * AC)

◆ removeEmptyBuckets()

void GNEApplicationWindowHelper::FileBucketHandler::removeEmptyBuckets ( )
private

removed empty buckets

Definition at line 2730 of file GNEApplicationWindowHelper.cpp.

References myBuckets, and FileBucket::types.

◆ resetDefaultFilenames()

void GNEApplicationWindowHelper::FileBucketHandler::resetDefaultFilenames ( )

brief set default files for all buckets

Definition at line 2607 of file GNEApplicationWindowHelper.cpp.

References myBuckets, and updateOptions().

◆ setDefaultFilenameFile()

void GNEApplicationWindowHelper::FileBucketHandler::setDefaultFilenameFile ( const FileBucket::Type type,
const std::string & filename )

brief set default additional file

Definition at line 2593 of file GNEApplicationWindowHelper.cpp.

References myBuckets, and updateOptions().

Referenced by getBucket().

Here is the caller graph for this function:

◆ unregisterAC()

void GNEApplicationWindowHelper::FileBucketHandler::unregisterAC ( const GNEAttributeCarrier * AC)

◆ updateAC()

◆ updateOptions()

void GNEApplicationWindowHelper::FileBucketHandler::updateOptions ( )

Field Documentation

◆ myApplicationWindow

GNEApplicationWindow* GNEApplicationWindowHelper::FileBucketHandler::myApplicationWindow = nullptr
private

pointer to application window

Definition at line 1249 of file GNEApplicationWindowHelper.h.

Referenced by FileBucketHandler(), and updateOptions().

◆ myBuckets

◆ myNeteditOptions

OptionsCont& GNEApplicationWindowHelper::FileBucketHandler::myNeteditOptions
private

reference to netedit options

Definition at line 1252 of file GNEApplicationWindowHelper.h.

Referenced by FileBucketHandler(), and updateOptions().

◆ mySumoOptions

OptionsCont& GNEApplicationWindowHelper::FileBucketHandler::mySumoOptions
private

reference to sumo options

Definition at line 1255 of file GNEApplicationWindowHelper.h.

Referenced by FileBucketHandler(), and updateOptions().


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