A library for working with phylogenetic and population genetic data.
v0.27.0
XmlValue Class Reference

#include <genesis/utils/formats/xml/document.hpp>

Inherited by XmlComment, XmlElement, and XmlMarkup.

Detailed Description

Definition at line 51 of file xml/document.hpp.

Public Member Functions

virtual ~XmlValue ()
 
bool is_comment ()
 
bool is_element ()
 
bool is_markup ()
 
Type type () const
 
std::string type_to_string () const
 

Static Public Member Functions

static std::string type_to_string (const Type t)
 

Public Types

enum  Type { kComment, kMarkup, kElement }
 

Protected Member Functions

 XmlValue (const Type type)
 Protected constructor that allows derived classes to set their value type. More...
 

Protected Attributes

const Type type_
 Stores the type of an object. Set by the constructor. More...
 

Constructor & Destructor Documentation

◆ ~XmlValue()

virtual ~XmlValue ( )
inlinevirtual

Definition at line 95 of file xml/document.hpp.

◆ XmlValue()

XmlValue ( const Type  type)
inlineprotected

Protected constructor that allows derived classes to set their value type.

Storing the type of each object as a special member saves the issue of using run time type inference, making it faster and easier to work with objects of different types.

Definition at line 104 of file xml/document.hpp.

Member Function Documentation

◆ is_comment()

bool is_comment ( )
inline

Definition at line 80 of file xml/document.hpp.

◆ is_element()

bool is_element ( )
inline

Definition at line 90 of file xml/document.hpp.

◆ is_markup()

bool is_markup ( )
inline

Definition at line 85 of file xml/document.hpp.

◆ type()

Type type ( ) const
inline

Definition at line 75 of file xml/document.hpp.

◆ type_to_string() [1/2]

std::string type_to_string ( ) const
inline

Definition at line 70 of file xml/document.hpp.

◆ type_to_string() [2/2]

static std::string type_to_string ( const Type  t)
inlinestatic

Definition at line 60 of file xml/document.hpp.

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
kComment 
kMarkup 
kElement 

Definition at line 54 of file xml/document.hpp.

Member Data Documentation

◆ type_

const Type type_
protected

Stores the type of an object. Set by the constructor.

Definition at line 107 of file xml/document.hpp.


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