cartobase  5.0.5
Generic object API changes

There has been three generations of generic objects with three different interfaces. The last two have disapeared: they are not present anymore in cartobase version 3.1, but still cited here for porting purpose.

  • GenericObject API: this is the new API that should be used now. The generic object is separated into several interface (Interface) API classes, each defining a set of virtual functions. The main interfaces are directly inherited by GenericObject: DictionaryInterface, StringInterface, ScalarInterface, ArrayInterface, SizeInterface, DictionaryIteratorInterface, IterableInterface and, for compatibility, GenObject.

    Some functions of DictionaryInterface replace older ones from the former GenObject and AttributedObject APIs:

    • getProperty() has several variants, either using a template (typed) parameter, either using a generic Object
    • setProperty() with several variants (same as for getProperty() )
    • hasProperty()
    • removeProperty()
    • copyProperties()
    • clearProperties()
  • old AttributedObject era and API:

    • getAttribute() is replaced by getProperty( string, T )
    • setAttribute() is replaced by setProperty( string, T )
    • hasAttribute() is replaced by hasProperty()
    • deleteAttribute() is replaced by removeProperty()
    • copyAttributes() is replaced by copyProperties()
    • deleteAttributes() is replaced by clearProperties()
    • getAttributes() has no equivalent in the new API but is not really needed
    • check() has not been reimplemented but was used only in IO

    AttributedObject is now a typedef to SyntaxedObject<Dictionary>

  • old GenObject era and API:

    • operator [] is not provided anymore because of the ambiguities it could cause. Use getProperty() instead.
    • count() is now size() (SizeInterface)
    • getNumber() is now getScalar() (ScalarInterface)
    • keys() has not been reimplemented
    • Object had a template constructor which caused some ambiguities for subclasses of GenericObject and GenObject, so it will be removed. Object construction is now handled by two "factory" functions: Object::value( T ) and Object::reference( T )
    • other functions of GenObject are still found in various Interface subclasses

    Once again, GenObject and AttributedObject don't exist anymore.