From 8a3f3f5b38bd11a8cc0da5c87b2f2e17beca288e Mon Sep 17 00:00:00 2001 From: "Marcel M. Otte" Date: Thu, 26 Oct 2017 21:37:44 +0200 Subject: [PATCH] Model with plantuml. --- doc/model.md | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 doc/model.md diff --git a/doc/model.md b/doc/model.md new file mode 100644 index 0000000..85f485e --- /dev/null +++ b/doc/model.md @@ -0,0 +1,106 @@ +# NPC core + +```plantuml +abstract class ARepository +abstract class ARepositoryFactory +class RepositoryFactory +class Repository { + +addStructure() + +removeStructure() + +getStructure() +} + +abstract class AStackModelFactory +class StackModelFactory + +abstract class AStackModel +class StackModel { + +getBinary():byte[] + +getStructures():Structure[] + +addStructure() + +removeStructure() +} + +abstract class AStructureFactory +class StructureFactory +abstract class AStructure +class Structure { + -name + -description + -fields + -data + +putData(Field, data) + +validateData(Field, data) + +updateData() +} + +abstract class AFieldFactory{ ++ createField() ++ createFieldBinaryInformation() ++ createFieldLogicalInformation() ++ createFieldVisualInformation() ++ createFieldRepresentation() +} +class FieldFactory +abstract class AField +class Field { + - owningStructure + - binary + - logical + - visual + - representation +} + +class RandomAccessBinary { + - binaryData + + setBytes(uint position, std::vector data) ++ setByte(uint position, uint8_t data) + ++ setBit(uint64_t position, bool value) ++ setBit(uint bytePosition, uint bitPosition, bool value) ++ setBits(uint64_t position, uint bits, uint value) ++ setBits(uint bytePosition, uint bitPosition, uint bits, uint value) + ++ getByte(uint position) ++ getBytes(uint position, uint bytes) + ++ getBit(uint64_t position) ++ getBit(uint bytePosition, uint bitPosition) ++ getBits(uint64_t position, uint bits) ++ getBits(uint bytePosition, uint bitPosition, uint bits) + ++ get_uint32(uint position) ++ get_uint16(uint position) ++ get_uint64(uint position) ++ get_float(uint position) ++ get_double(uint position) + ++ get_string(uint position, uint length) + ++ get_hex_string(uint position, uint length) ++ get_hex_string() +} + +ARepositoryFactory <|-- RepositoryFactory +ARepository <|-- Repository +RepositoryFactory --> Repository : creates > + +AStackModelFactory <|-- StackModelFactory +AStackModel <|-- StackModel +StackModelFactory --> StackModel: creates > + +AStructureFactory <|-- StructureFactory +AStructure <|-- Structure +StructureFactory --> Structure : creates > +StackModel *-- Structure +Repository *-- Structure + +AFieldFactory <|-- FieldFactory +AField <|-- Field +FieldFactory --> Field : creates > + +Structure *-- Field + +StackModel *-- "1" RandomAccessBinary + +```