ome-xml  5.6.0
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
ome::xml::model::enums::NamingConvention Class Reference

NamingConvention enumeration. More...

#include <ome/xml/model/enums/NamingConvention.h>

+ Collaboration diagram for ome::xml::model::enums::NamingConvention:

Public Types

enum  enum_value { LETTER, NUMBER }
 Enumeration values. More...
 
typedef std::map< std::string, NamingConvention::enum_valuestring_map_type
 String map type.
 
typedef std::map< NamingConvention::enum_value, std::string > value_map_type
 Value map type.
 

Public Member Functions

 NamingConvention (enum_value value)
 Construct a NamingConvention enumeration by an enumeration value. More...
 
 NamingConvention (const std::string &name, bool strict=true)
 Construct a NamingConvention enumeration by an enumeration name. More...
 
 NamingConvention (const NamingConvention &original)
 Copy constructor. More...
 
NamingConventionoperator= (const NamingConvention &rhs)
 Assignment operator. More...
 
 operator enum_value () const
 Cast the enumeration to its value. More...
 
 operator const std::string & () const
 Cast the enumeration to its name. More...
 

Static Public Member Functions

static const string_map_typestrings ()
 Get a map of valid string names and enum values. More...
 
static const value_map_typevalues ()
 Get a map of valid enum values and string names. More...
 

Static Private Member Functions

static const string_map_typelowercase_strings ()
 Get a map of valid lowercased string names and enum values. More...
 

Private Attributes

enum_value value
 Enumeration value.
 
const std::string * name
 Enumeration name.
 

Detailed Description

NamingConvention enumeration.

Member Enumeration Documentation

◆ enum_value

Enumeration values.

Enumerator
LETTER 

While the label type 'number' has a clear meaning the 'letter' type is more complex.

If you have less than 26 values use letters A to Z. Once you get more than 26 values there are several different approaches in use. One we have see include:

Single letter, then double letter each running A to Z, right first e.g. A, B, C, ... X, Y, Z, AA, AB, AC, ... AY, AZ, BA, BB, ... This is the format used by Microsoft Excel so users may be familiar with it. This is the approach we use in the OMERO client applications.

CAPITALsmall, each running A to Z, small first e.g. Aa, Ab, Ac, ... Ax, Ay, Az, Ba, Bb, Bc, ... By, Bz, Ca, Cb, ... This is in use by some plate manufactures.

Single letter, then double letter, then triple letter, and so on e.g. A, B, C, ... X, Y, Z, AA, BB, CC, ... YY, ZZ, AAA, BBB, ... This has the advantage that the first 26 are the same as the standard but has a problem an the labels get wider and wider leading to user interface problems.

NUMBER 

1, 2, 3, ...

Constructor & Destructor Documentation

◆ NamingConvention() [1/3]

ome::xml::model::enums::NamingConvention::NamingConvention ( enum_value  value)

Construct a NamingConvention enumeration by an enumeration value.

Parameters
valuethe value of the enumeration.

References name, and values().

Referenced by ome::xml::model::enums::operator>>().

+ Here is the caller graph for this function:

◆ NamingConvention() [2/3]

ome::xml::model::enums::NamingConvention::NamingConvention ( const std::string &  name,
bool  strict = true 
)

Construct a NamingConvention enumeration by an enumeration name.

Exact matching of the name will require the name to match one of the valid enumeration names. Inexact matching will strip leading and trailing whitespace and perform a case-insensitive match. Exact matching is recommended for use in program code which does not process user input; inexact matching is recommended when processing potentially malformed user input.

Parameters
namethe name of the enumeration.
stricttrue to require an exact name, false to allow an inexact match.

References lowercase_strings(), strings(), trim(), value, and values().

◆ NamingConvention() [3/3]

ome::xml::model::enums::NamingConvention::NamingConvention ( const NamingConvention original)

Copy constructor.

Parameters
originalthe instance to copy.

Member Function Documentation

◆ lowercase_strings()

const NamingConvention::string_map_type & ome::xml::model::enums::NamingConvention::lowercase_strings ( )
staticprivate

Get a map of valid lowercased string names and enum values.

Returns
a map of lowercased string names to enum values.

References LETTER, and NUMBER.

Referenced by NamingConvention().

+ Here is the caller graph for this function:

◆ operator const std::string &()

ome::xml::model::enums::NamingConvention::operator const std::string & ( ) const
inline

Cast the enumeration to its name.

Returns
the enumeration value.

References name.

◆ operator enum_value()

ome::xml::model::enums::NamingConvention::operator enum_value ( ) const
inline

Cast the enumeration to its value.

Returns
the enumeration value.

References value.

◆ operator=()

NamingConvention& ome::xml::model::enums::NamingConvention::operator= ( const NamingConvention rhs)
inline

Assignment operator.

Parameters
rhsthe value to assign.
Returns
the assigned value.

References name, and value.

◆ strings()

const NamingConvention::string_map_type & ome::xml::model::enums::NamingConvention::strings ( )
static

Get a map of valid string names and enum values.

Returns
a map of string names to enum values.

References LETTER, and NUMBER.

Referenced by NamingConvention().

+ Here is the caller graph for this function:

◆ values()

const NamingConvention::value_map_type & ome::xml::model::enums::NamingConvention::values ( )
static

Get a map of valid enum values and string names.

Returns
a map of enum values to string names.

References LETTER, and NUMBER.

Referenced by NamingConvention().

+ Here is the caller graph for this function:

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