NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
NumeRe::ClusterManager Class Reference

This class is the management class for the different clusters, which are currently available in memory. More...

#include <cluster.hpp>

Inheritance diagram for NumeRe::ClusterManager:
Collaboration diagram for NumeRe::ClusterManager:

Public Member Functions

 ClusterManager ()
 
 ~ClusterManager ()
 
bool containsClusters (const std::string &sCmdLine) const
 This member function detects, whether any cluster is used in the current expression. More...
 
bool isCluster (StringView sCluster) const
 This member function returns true, if the passed cluster identifier can be found in the internal map. More...
 
bool isCluster (const std::string &sCluster) const
 This member function returns true, if the passed cluster identifier can be found in the internal map. More...
 
ClustergetCluster (StringView sCluster)
 This member function returns a reference to the cluster indicated by the passed cluster identifier. More...
 
ClustergetCluster (const std::string &sCluster)
 This member function returns a reference to the cluster indicated by the passed cluster identifier. More...
 
const ClustergetCluster (const std::string &sCluster) const
 This member function returns a const reference to the cluster indicated by the passed cluster identifier. Used in context when this object is passed as const reference. More...
 
ClusternewCluster (const std::string &sCluster)
 This member function creates a new cluster from the passed cluster identifier and returns a reference to this new object. More...
 
void appendCluster (const std::string &sCluster, const Cluster &cluster)
 This member function appends the passed cluster to the internal cluster map using the passed string as the identifier. More...
 
void removeCluster (const std::string &sCluster)
 This member function removes the cluster from memory, which corresponds to the passed cluster identifier. More...
 
std::string createTemporaryCluster (const std::string &suffix="")
 This member function creates a temporary cluster with a unique name and returns this name to the calling function. More...
 
void removeTemporaryClusters ()
 This member function returns all temporary clusters from the internal map. Temporary clusters are indicated by their name. More...
 
void clearAllClusters ()
 Clear all clusters currently in memory. More...
 
bool updateClusterSizeVariables (StringView sCluster)
 This member function updates the dimension variable reserved for cluster accesses with the size of the current accessed cluster. More...
 
const std::map< std::string, Cluster > & getClusterMap () const
 

Public Attributes

mu::value_type dClusterElementsCount
 

Private Member Functions

std::string validateClusterName (const std::string &sCluster)
 This member function creates a valid cluster identifier name, which can be used to create or append a new cluster. More...
 
std::map< std::string, Cluster >::iterator mapStringViewFind (StringView view)
 This private member function returns an iterator to the referenced cluster or std::map::end(). More...
 
std::map< std::string, Cluster >::const_iterator mapStringViewFind (StringView view) const
 This private member function returns an iterator to the referenced cluster or std::map::end(). More...
 

Private Attributes

std::map< std::string, ClustermClusterMap
 

Detailed Description

This class is the management class for the different clusters, which are currently available in memory.

Definition at line 446 of file cluster.hpp.

Constructor & Destructor Documentation

◆ ClusterManager()

NumeRe::ClusterManager::ClusterManager ( )
inline

Definition at line 456 of file cluster.hpp.

References dClusterElementsCount.

◆ ~ClusterManager()

NumeRe::ClusterManager::~ClusterManager ( )
inline

Definition at line 457 of file cluster.hpp.

Member Function Documentation

◆ appendCluster()

void NumeRe::ClusterManager::appendCluster ( const std::string &  sCluster,
const Cluster cluster 
)

This member function appends the passed cluster to the internal cluster map using the passed string as the identifier.

Parameters
sClusterconst std::string&
clusterconst Cluster&
Returns
void

Definition at line 2158 of file cluster.cpp.

References mClusterMap, and validateClusterName().

Here is the call graph for this function:

◆ clearAllClusters()

void NumeRe::ClusterManager::clearAllClusters ( )

Clear all clusters currently in memory.

Returns
void

Definition at line 2229 of file cluster.cpp.

References mClusterMap.

Referenced by cmd_clear().

◆ containsClusters()

bool NumeRe::ClusterManager::containsClusters ( const std::string &  sCmdLine) const

This member function detects, whether any cluster is used in the current expression.

Parameters
sCmdLineconst std::string&
Returns
bool

Definition at line 1989 of file cluster.cpp.

References mClusterMap.

Referenced by NumeRe::StringFuncHandler::argumentParser(), cmd_pack(), MemoryManager::containsTablesOrClusters(), and resolveTablesAndClusters().

◆ createTemporaryCluster()

std::string NumeRe::ClusterManager::createTemporaryCluster ( const std::string &  suffix = "")

This member function creates a temporary cluster with a unique name and returns this name to the calling function.

Parameters
suffixconst std::string&
Returns
std::string

Definition at line 2191 of file cluster.cpp.

References mClusterMap, and toString().

Referenced by ProcedureVarFactory::createLocalInlineStrings(), ProcedureVarFactory::createLocalInlineVars(), ProcedureVarFactory::evaluateProcedureArguments(), Procedure::getInlined(), and FlowCtrl::range_based_for_loop().

Here is the call graph for this function:

◆ getCluster() [1/3]

Cluster & NumeRe::ClusterManager::getCluster ( const std::string &  sCluster)

This member function returns a reference to the cluster indicated by the passed cluster identifier.

Parameters
sClusterconst std::string&
Returns
Cluster&

Definition at line 2097 of file cluster.cpp.

References SyntaxError::CLUSTER_DOESNT_EXIST, and mClusterMap.

◆ getCluster() [2/3]

const Cluster & NumeRe::ClusterManager::getCluster ( const std::string &  sCluster) const

This member function returns a const reference to the cluster indicated by the passed cluster identifier. Used in context when this object is passed as const reference.

Parameters
sClusterconst std::string&
Returns
const Cluster&

Definition at line 2119 of file cluster.cpp.

References SyntaxError::CLUSTER_DOESNT_EXIST, and mClusterMap.

◆ getCluster() [3/3]

◆ getClusterMap()

◆ isCluster() [1/2]

bool NumeRe::ClusterManager::isCluster ( const std::string &  sCluster) const

This member function returns true, if the passed cluster identifier can be found in the internal map.

Parameters
sClusterconst std::string&
Returns
bool

Definition at line 2059 of file cluster.cpp.

References mClusterMap.

◆ isCluster() [2/2]

bool NumeRe::ClusterManager::isCluster ( StringView  sCluster) const

This member function returns true, if the passed cluster identifier can be found in the internal map.

Parameters
sClusterStringView
Returns
bool

Definition at line 2041 of file cluster.cpp.

References StringViewBase::find(), mapStringViewFind(), mClusterMap, and StringView::subview().

Referenced by NumeRe::StringFuncHandler::applySpecialStringFuncs(), ProcedureVarFactory::createLocalClusters(), DataAccessParser::DataAccessParser(), NumeReDebugger::decodeType(), deleteCacheEntry(), ProcedureVarFactory::evaluateProcedureArguments(), NumeReKernel::getStringTable(), isClusterCandidate(), isCompleteCluster(), performMatrixOperation(), Plot::separateFunctionsAndData(), and updateClusterSizeVariables().

Here is the call graph for this function:

◆ mapStringViewFind() [1/2]

std::map< std::string, Cluster >::iterator NumeRe::ClusterManager::mapStringViewFind ( StringView  view)
private

This private member function returns an iterator to the referenced cluster or std::map::end().

Parameters
viewStringView
Returns
std::map<std::string, Cluster>::iterator

Definition at line 1967 of file cluster.cpp.

References mClusterMap.

Referenced by getCluster(), and isCluster().

◆ mapStringViewFind() [2/2]

std::map< std::string, Cluster >::const_iterator NumeRe::ClusterManager::mapStringViewFind ( StringView  view) const
private

This private member function returns an iterator to the referenced cluster or std::map::end().

Parameters
viewStringView
Returns
std::map<std::string, Cluster>::const_iterator

Definition at line 1945 of file cluster.cpp.

References mClusterMap.

◆ newCluster()

Cluster & NumeRe::ClusterManager::newCluster ( const std::string &  sCluster)

This member function creates a new cluster from the passed cluster identifier and returns a reference to this new object.

Parameters
sClusterconst std::string&
Returns
Cluster&

Definition at line 2139 of file cluster.cpp.

References mClusterMap, and validateClusterName().

Referenced by cmd_clear(), ProcedureVarFactory::createLocalClusters(), ProcedureVarFactory::createTestStatsCluster(), ProcedureVarFactory::evaluateProcedureArguments(), isClusterCandidate(), performMatrixOperation(), and NumeReKernel::StartUp().

Here is the call graph for this function:

◆ removeCluster()

void NumeRe::ClusterManager::removeCluster ( const std::string &  sCluster)

This member function removes the cluster from memory, which corresponds to the passed cluster identifier.

Parameters
sClusterconst std::string&
Returns
void

Definition at line 2173 of file cluster.cpp.

References mClusterMap.

Referenced by ProcedureVarFactory::createLocalClusters(), ProcedureVarFactory::evaluateProcedureArguments(), FlowCtrl::reset(), and ProcedureVarFactory::reset().

◆ removeTemporaryClusters()

void NumeRe::ClusterManager::removeTemporaryClusters ( )

This member function returns all temporary clusters from the internal map. Temporary clusters are indicated by their name.

Returns
void

Definition at line 2209 of file cluster.cpp.

References mClusterMap.

Referenced by NumeReKernel::MainLoop().

◆ updateClusterSizeVariables()

bool NumeRe::ClusterManager::updateClusterSizeVariables ( StringView  sCluster)

This member function updates the dimension variable reserved for cluster accesses with the size of the current accessed cluster.

Parameters
sClusterStringView
Returns
bool

Definition at line 2245 of file cluster.cpp.

References dClusterElementsCount, StringViewBase::find(), getCluster(), isCluster(), NumeRe::Cluster::size(), and StringView::subview().

Referenced by getIndices().

Here is the call graph for this function:

◆ validateClusterName()

std::string NumeRe::ClusterManager::validateClusterName ( const std::string &  sCluster)
private

This member function creates a valid cluster identifier name, which can be used to create or append a new cluster.

Parameters
sClusterconst std::string&
Returns
std::string

Definition at line 1924 of file cluster.cpp.

References SyntaxError::INVALID_CLUSTER_NAME, and SyntaxError::invalid_position.

Referenced by appendCluster(), and newCluster().

Member Data Documentation

◆ dClusterElementsCount

mu::value_type NumeRe::ClusterManager::dClusterElementsCount

Definition at line 459 of file cluster.hpp.

Referenced by ClusterManager(), NumeReKernel::StartUp(), and updateClusterSizeVariables().

◆ mClusterMap

std::map<std::string, Cluster> NumeRe::ClusterManager::mClusterMap
private

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