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::SgfcPropertyDualValueTypeDescriptor Class Reference

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

#include <SgfcPropertyDualValueTypeDescriptor.h>

Inheritance diagram for LibSgfcPlusPlus::SgfcPropertyDualValueTypeDescriptor:
LibSgfcPlusPlus::ISgfcPropertyValueTypeDescriptor

Public Member Functions

 SgfcPropertyDualValueTypeDescriptor (std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType1, std::shared_ptr< ISgfcPropertyValueTypeDescriptor > descriptorValueType2)
 Initializes a newly constructed SgfcPropertyDualValueTypeDescriptor object.
 
virtual ~SgfcPropertyDualValueTypeDescriptor ()
 Destroys and cleans up the SgfcPropertyDualValueTypeDescriptor 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 SgfcPropertyDualValueTypeDescriptorToDualValueTypeDescriptor () const override
 Returns an SgfcPropertyDualValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::DualValueType. 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 first of the two possible value types.
 
virtual std::shared_ptr< ISgfcPropertyValueTypeDescriptorGetDescriptorValueType2 () const
 Returns an ISgfcPropertyValueTypeDescriptor object that describes the second of the two possible value types.
 
- 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 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 SgfcPropertyComposedValueTypeDescriptorToComposedValueTypeDescriptor () const
 Returns an SgfcPropertyComposedValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::ComposedValueType. 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 SgfcPropertyDualValueTypeDescriptor class provides an implementation of the ISgfcPropertyValueTypeDescriptor interface. See the interface header file for documentation.

SgfcPropertyDualValueTypeDescriptor expresses the fact that for some properties the raw SGF property value can be either of a first type, or a second type. Which one needs to be determined by probing, i.e. by parsing the raw property value. GetDescriptorValueType1() returns a descriptor for the first possible value type, GetDescriptorValueType2() returns a descriptor for the second possible value type.

Note
The two descriptors must be either SgfcPropertyBasicValueTypeDescriptor or SgfcPropertyComposedValueTypeDescriptor objects.

Example: The "SZ" property value either is a single number, or it is a composed Number/Number. GetDescriptorValueType1() in this case returns an SgfcPropertyBasicValueTypeDescriptor object which has the basic value type SgfcPropertyValueType::Number. GetDescriptorValueType2() returns an SgfcPropertyComposedValueTypeDescriptor object, which in turn is composed of two descriptors of type SgfcPropertyBasicValueTypeDescriptor, both of which have the basic value type SgfcPropertyValueType::Number.

Constructor & Destructor Documentation

◆ SgfcPropertyDualValueTypeDescriptor()

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

Initializes a newly constructed SgfcPropertyDualValueTypeDescriptor object.

Exceptions
std::logic_errorIs thrown if one or both of the two descriptor objects are neither SgfcPropertyBasicValueTypeDescriptor nor SgfcPropertyComposedValueTypeDescriptor objects.

Member Function Documentation

◆ GetDescriptorType()

SgfcPropertyValueTypeDescriptorType LibSgfcPlusPlus::SgfcPropertyDualValueTypeDescriptor::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.

◆ ToDualValueTypeDescriptor()

const SgfcPropertyDualValueTypeDescriptor * LibSgfcPlusPlus::SgfcPropertyDualValueTypeDescriptor::ToDualValueTypeDescriptor ( ) const
overridevirtual

Returns an SgfcPropertyDualValueTypeDescriptor object if GetDescriptorType() returns SgfcPropertyValueTypeDescriptorType::DualValueType. 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: