libsgfc++ 2.0.1
A C++ library that uses SGFC to read and write SGF (Smart Game Format) data.
|
The SgfcPropertyFactory class provides an implementation of the ISgfcPropertyFactory interface. See the interface header file for documentation. More...
#include <SgfcPropertyFactory.h>
Public Member Functions | |
ISgfcProperty - Create with property type | |
virtual std::shared_ptr< ISgfcProperty > | CreateProperty (SgfcPropertyType propertyType) const override |
Returns a newly constructed ISgfcProperty object that has the specified property type propertyType. The property has no values. The property is not associated with any node. | |
virtual std::shared_ptr< ISgfcProperty > | CreateProperty (SgfcPropertyType propertyType, std::shared_ptr< ISgfcPropertyValue > propertyValue) const override |
Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property value propertyValue. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue. | |
virtual std::shared_ptr< ISgfcProperty > | CreateProperty (SgfcPropertyType propertyType, const std::vector< std::shared_ptr< ISgfcPropertyValue > > &propertyValues) const override |
Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property values propertyValues. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues. | |
ISgfcProperty - Create with property name | |
virtual std::shared_ptr< ISgfcProperty > | CreateProperty (const std::string &propertyName) const override |
Returns a newly constructed ISgfcProperty object that has the specified property name propertyName. The property type is inferred from the property name. The property has no values. The property is not associated with any node. | |
virtual std::shared_ptr< ISgfcProperty > | CreateProperty (const std::string &propertyName, std::shared_ptr< ISgfcPropertyValue > propertyValue) const override |
Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property value propertyValue. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue. | |
virtual std::shared_ptr< ISgfcProperty > | CreateProperty (const std::string &propertyName, const std::vector< std::shared_ptr< ISgfcPropertyValue > > &propertyValues) const override |
Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property values propertyValues. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues. | |
Concrete property types - ISgfcBoardSizeProperty | |
virtual std::shared_ptr< ISgfcBoardSizeProperty > | CreateBoardSizeProperty () const override |
Returns a newly constructed ISgfcBoardSizeProperty object that has no value. The property is not associated with any node. | |
virtual std::shared_ptr< ISgfcBoardSizeProperty > | CreateBoardSizeProperty (std::shared_ptr< ISgfcNumberPropertyValue > propertyValue) const override |
Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue. | |
virtual std::shared_ptr< ISgfcBoardSizeProperty > | CreateBoardSizeProperty (std::shared_ptr< ISgfcComposedPropertyValue > propertyValue) const override |
Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcComposedPropertyValue object propertyValue. | |
Public Member Functions inherited from LibSgfcPlusPlus::ISgfcPropertyFactory | |
ISgfcPropertyFactory () | |
Initializes a newly constructed ISgfcPropertyFactory object. | |
virtual | ~ISgfcPropertyFactory () |
Destroys and cleans up the ISgfcPropertyFactory object. | |
Concrete property types - ISgfcGameTypeProperty | |
virtual std::shared_ptr< ISgfcGameTypeProperty > | CreateGameTypeProperty () const override |
Returns a newly constructed ISgfcGameTypeProperty object that has no value. The property is not associated with any node. | |
virtual std::shared_ptr< ISgfcGameTypeProperty > | CreateGameTypeProperty (std::shared_ptr< ISgfcNumberPropertyValue > propertyValue) const override |
Returns a newly constructed ISgfcGameTypeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcGameTypeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue. | |
The SgfcPropertyFactory class provides an implementation of the ISgfcPropertyFactory interface. See the interface header file for documentation.
|
overridevirtual |
Returns a newly constructed ISgfcBoardSizeProperty object that has no value. The property is not associated with any node.
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcComposedPropertyValue object propertyValue.
This overload constructs an ISgfcBoardSizeProperty object that describes a rectangular board.
std::invalid_argument | Is thrown if propertyValue is nullptr, or if the propertyValue object is not composed of two ISgfcNumberPropertyValue objects. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcBoardSizeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcBoardSizeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue.
This overload constructs an ISgfcBoardSizeProperty object that describes a square board.
std::invalid_argument | Is thrown if propertyValue is nullptr. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcGameTypeProperty object that has no value. The property is not associated with any node.
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcGameTypeProperty object that has the specified property value propertyValue. The property is not associated with any node. The ISgfcGameTypeProperty object takes ownership of the ISgfcNumberPropertyValue object propertyValue.
std::invalid_argument | Is thrown if propertyValue is nullptr. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcProperty object that has the specified property name propertyName. The property type is inferred from the property name. The property has no values. The property is not associated with any node.
Attempts to map propertyName to a value in the enumeration SgfcPropertyType. If the mapping succeeds the result of invoking this method is the same as invoking the overload that takes an SgfcPropertyType value. If the mapping fails then the resulting ISgfcProperty object has SgfcPropertyType::Unknown.
If the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property values propertyValues. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues.
Attempts to map propertyName to a value in the enumeration SgfcPropertyType. If the mapping succeeds the result of invoking this method is the same as invoking the overload that takes an SgfcPropertyType value. If the mapping fails then the resulting ISgfcProperty object has SgfcPropertyType::Unknown.
If the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.
std::invalid_argument | Is thrown if propertyValues contains a nullptr element, or if propertyValues contains duplicate elements. Is also thrown if the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValues contains more than one value or the value does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcProperty object that has the specified property name propertyName and the specified property value propertyValue. The property type is inferred from the property name. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue.
Attempts to map propertyName to a value in the enumeration SgfcPropertyType. If the mapping succeeds the result of invoking this method is the same as invoking the overload that takes an SgfcPropertyType value. If the mapping fails then the resulting ISgfcProperty object has SgfcPropertyType::Unknown.
If the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.
std::invalid_argument | Is thrown if propertyValue is nullptr. Is also thrown if the mapped SgfcPropertyType value is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValue does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcProperty object that has the specified property type propertyType. The property has no values. The property is not associated with any node.
If propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.
std::invalid_argument | Is thrown if propertyType is SgfcPropertyType::Unknown. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property values propertyValues. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue objects in propertyValues.
If propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.
std::invalid_argument | Is thrown if propertyType is SgfcPropertyType::Unknown, or if propertyValues contains a nullptr element, or if propertyValues contains duplicate elements. Is also thrown if propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValues contains more than one value or the value does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.
|
overridevirtual |
Returns a newly constructed ISgfcProperty object that has the specified property type propertyType and the specified property value propertyValue. The property is not associated with any node. The ISgfcProperty object takes ownership of the ISgfcPropertyValue object propertyValue.
If propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM, the returned ISgfcProperty object is an instance of ISgfcBoardSizeProperty or ISgfcGameTypeProperty.
std::invalid_argument | Is thrown if propertyType is SgfcPropertyType::Unknown, or if propertyValue is nullptr. Is also thrown if propertyType is SgfcPropertyType::SZ or SgfcPropertyType::GM and propertyValue does not meet the requirements of these property types. See the documentation of CreateBoardSizeProperty() or CreateGameTypeProperty() for details. |
Implements LibSgfcPlusPlus::ISgfcPropertyFactory.