Skip to content
Back to top
View this page

# Definitions

class dsviper.Definitions

  Bases: `object`

  A class used to register concept, club, enumeration, structure and attachment.

  const() → DefinitionsConst

    Return the DefinitionsConst interface.

  create_attachment(namespace: NameSpace, name: str, key_type: _AbstractionTypes, document_type: Type, *, documentation: str | None = None) → Attachment

    Create an attachment.

  create_club(namespace: NameSpace, name: str, *, documentation: str | None = None) → TypeClub

    Create and return a club.

  create_concept(namespace: NameSpace, name: str, *, documentation: str | None = None, parent: TypeConcept | None = None) → TypeConcept

    Create and return a concept.

  create_enumeration(namespace: NameSpace, enumeration_descriptor: TypeEnumerationDescriptor) → TypeEnumeration

    Create and return an enum from a descriptor.

  create_membership(type_club: TypeClub, type_concept: TypeConcept) → None

    Create a club membership.

  create_structure(namespace: NameSpace, structure_descriptor: TypeStructureDescriptor) → TypeStructure

    Create and return a struct from a descriptor.

  static decode(blob: ValueBlob, *, stream_codec_instancing: StreamCodecInstancing | None = None) → Definitions

    Return a Definitions by decoding the blob with a StreamTokenBinaryCodec if not specified.

  extend(definitions: DefinitionsConst) → DefinitionsExtendInfo

    Extend the registered types with the types of definitions and return information about added definitions.

  extend_concepts(definitions: DefinitionsConst) → set[ValueUUId]

    Extend the registered concepts with the concepts of definitions.

  static read(stream_reading: StreamReading) → Definitions

    Read and return a Definitions.