122 [[nodiscard]]
virtual std::string
serialize()
const = 0;
135 [[nodiscard]]
virtual std::string
getType()
const = 0;
148 static std::string
calculateHash(
const std::string& content);
159 [[nodiscard]] std::string
getHashId()
const;
187 std::string type_name;
196 std::string content_data;
220 [[nodiscard]] std::string
serialize()
const override;
230 [[nodiscard]] std::string
getType()
const override;
Helper class for testing the non-abstract methods of VcsObject.
Definition VcsObject.hxx:113
std::string serialize() const override
Implementation of the pure virtual method. Returns the stored content.
Definition VcsObject.cxx:58
std::string getType() const override
Implementation of the pure virtual method. Returns the stored type name.
Definition VcsObject.cxx:62
TestableObject(std::string type, std::string data)
Primary constructor.
Definition VcsObject.cxx:53
Abstract base class representing any storable, addressable object within the VCS.
Definition VcsObject.hxx:33
virtual std::string getType() const =0
Pure virtual method to get the type of the VCS object.
std::string getHashId() const
Returns the unique hash identifier of the object.
Definition VcsObject.cxx:34
virtual std::string serialize() const =0
Pure virtual method to serialize the object's core data.
void computeHash(const std::string &content)
Computes the cryptographic hash ID for the object's content.
Definition VcsObject.cxx:20
VcsObject()=default
Default constructor. Required for derived classes.
virtual ~VcsObject()=default
Virtual destructor.
static std::string calculateHash(const std::string &content)
Calculates SHA-256 hash for given canonical content.
Definition VcsObject.cxx:38
std::string hash_id
The unique cryptographic hash identifier (e.g., SHA-256) for this object.
Definition VcsObject.hxx:40
Core VCS data structures and object model.