libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor Class Reference

The SgfcPropertyComposedValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation. More...

#include <SgfcPropertyComposedValueTypeDescriptor.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor:
LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor

Public Member Functions

 SgfcPropertyComposedValueTypeDescriptor (std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType1, std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType2)
 Initializes a newly constructed SgfcPropertyComposedValueTypeDescriptor object.
 
virtual ~SgfcPropertyComposedValueTypeDescriptor ()
 Destroys and cleans up the SgfcPropertyComposedValueTypeDescriptor object.
 
virtual SgfcPropertyValueTypeDescriptorType GetDescriptorType () const override
 Returns the concrete type of the descriptor object. Depending on the value returned, a caller then knows which one of the convenience casting methods to use.
 
virtual const SgfcPropertyComposedValueTypeDescriptorToComposedValueTypeDescriptor () const override
 Returns an SgfcPropertyComposedValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ComposedValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual std::shared_ptr< ISgfcPropertyValueTypeDescriptorGetDescriptorValueType1 () const
 Returns an ISgfcPropertyValueTypeDescriptor object that describes the value type of the first value.
 
virtual std::shared_ptr< ISgfcPropertyValueTypeDescriptorGetDescriptorValueType2 () const
 Returns an ISgfcPropertyValueTypeDescriptor object that describes the value type of the second value.
 
- Public Member Functions inherited from LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor
 ISgfcPropertyValueTypeDescriptor ()
 Initializes a newly constructed ISgfcPropertyValueTypeDescriptor object.
 
virtual ~ISgfcPropertyValueTypeDescriptor ()
 Destroys and cleans up the ISgfcPropertyValueTypeDescriptor object.
 
virtual const SgfcPropertyDualValueTypeDescriptorToDualValueTypeDescriptor () const
 Returns an SgfcPropertyDualValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::DualValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const SgfcPropertyElistValueTypeDescriptorToElistValueTypeDescriptor () const
 Returns an SgfcPropertyListValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ElistValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const SgfcPropertyListValueTypeDescriptorToListValueTypeDescriptor () const
 Returns an SgfcPropertyElistValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ListValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 
virtual const SgfcPropertyBasicValueTypeDescriptorToBasicValueTypeDescriptor () const
 Returns an SgfcPropertyBasicValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::BasicValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.
 

Detailed Description

The SgfcPropertyComposedValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation.

SgfcPropertyComposedValueTypeDescriptor expresses the fact that for some properties the raw SGF property value is composed of two values, separated by a colon (":") character. GetDescriptorValueType1() returns a descriptor for the value type of the first value, GetDescriptorValueType2() returns a descriptor for the value type of the second value.

Note
The two descriptors must be SgfcPropertyBasicValueTypeDescriptor objects, and their value types must not be SgfcPropertyValueType::None.

Example: The "AP" property value is composed of two SimpleText values separated by a ":" character. Both GetDescriptorValueType1() and GetDescriptorValueType2() in this case return SgfcPropertyBasicValueTypeDescriptor objects which both have the basic value type SgfcPropertyValueType::SimpleText.

Constructor & Destructor Documentation

◆ SgfcPropertyComposedValueTypeDescriptor()

LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor::SgfcPropertyComposedValueTypeDescriptor ( std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType1,
std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType2 )

Initializes a newly constructed SgfcPropertyComposedValueTypeDescriptor object.

Exceptions
std::logic_errorIs thrown if one or both of the two descriptor objects are not SgfcPropertyBasicValueTypeDescriptor objects, or if the basic value type is SgfcPropertyValueType::None.

Member Function Documentation

◆ GetDescriptorType()

SgfcPropertyValueTypeDescriptorType LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor::GetDescriptorType ( ) const
overridevirtual

Returns the concrete type of the descriptor object. Depending on the value returned, a caller then knows which one of the convenience casting methods to use.

Implements LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor.

◆ ToComposedValueTypeDescriptor()

const SgfcPropertyComposedValueTypeDescriptor * LibSgfcPlusPlus::SgfcPropertyComposedValueTypeDescriptor::ToComposedValueTypeDescriptor ( ) const
overridevirtual

Returns an SgfcPropertyComposedValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ComposedValueType. Returns nullptr otherwise. The caller is not the owner of the returned object.

Reimplemented from LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor.


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