FOSSredder 0.5.0
Loading...
Searching...
No Matches
core::domain::Contract Class Reference

#include <Contract.h>

Public Member Functions

 Contract ()
 Contract (const Contract &)=delete
Contract & operator= (const Contract &)=delete
 Contract (Contract &&)=delete
Contract & operator= (Contract &&)=delete
void rename (EntityName value)
 Renames the contract with normalized entity text.
void rename (std::string value)
 Renames the contract with raw text.
void setType (ContractType value)
 Sets the contract type from a normalized value object.
void setType (std::string value)
 Sets the contract type from raw text.
void setAllocatableMode (std::string value)
void setActorIds (std::vector< std::string > value)
 Replaces the linked actor ids with normalized values.
void addActorId (std::string value)
 Adds an actor id when it is not already present.
void removeActorId (const std::string &value)
 Removes an actor id from the contract.
void clearActorIds ()
 Clears all linked actor ids.
void setPropertyIds (std::vector< std::string > value)
 Replaces the linked property ids with normalized values.
void addPropertyId (std::string value)
 Adds a property id when it is not already present.
void removePropertyId (const std::string &value)
 Removes a property id from the contract.
void clearPropertyIds ()
 Clears all linked property ids.
void addAlias (Alias value)
 Adds a normalized alias when it is not already present.
void removeAlias (std::string value)
 Removes an alias.
void recordAliasHit (std::string value, std::string timestamp={})
 Records a usage hit for an alias.
bool hasName () const noexcept
 Checks whether the contract has a name.
bool hasAlias (const std::string &value) const
 Checks whether an alias exists on the contract.
std::size_t aliasCount () const noexcept
 Returns the number of aliases.
bool hasAliases () const noexcept
 Checks whether the contract has any aliases.
void clearAliases ()
 Clears all aliases from the contract.
bool containsActorId (const std::string &value) const
 Checks whether an actor id exists.
bool containsPropertyId (const std::string &value) const
 Checks whether a property id exists.
bool hasSingleActor () const noexcept
 Checks whether the contract has exactly one actor.
bool hasActorRelations () const noexcept
 Checks whether any actor relations exist.
bool hasPropertyRelations () const noexcept
 Checks whether any property relations exist.
bool hasRelations () const noexcept
 Checks whether the contract has any relations.
std::size_t relationCount () const noexcept
 Returns the total number of linked relations.
std::size_t actorCount () const noexcept
 Returns the number of linked actors.
std::size_t propertyCount () const noexcept
 Returns the number of linked properties.
bool hasType () const noexcept
 Checks whether the contract has a type.
bool isConfigured () const noexcept
 Checks whether the contract is fully configured.
bool isMatchingReady () const noexcept
 Checks whether the contract is ready for matching.
bool isStandalone () const noexcept
 Checks whether the contract has no actor or property links.
const std::string & id () const noexcept
const std::string & name () const noexcept
const std::string & type () const noexcept
const std::string & allocatableMode () const noexcept
const std::vector< std::string > & actorIds () const noexcept
const std::vector< std::string > & propertyIds () const noexcept
const std::vector< Alias > & aliases () const noexcept
const std::string & createdAt () const noexcept
const std::string & updatedAt () const noexcept
void setId (std::string value)
void setAliases (std::vector< Alias > value)
void setCreatedAt (std::string value)
void setUpdatedAt (std::string value)

Detailed Description

Definition at line 20 of file Contract.h.

Constructor & Destructor Documentation

◆ Contract() [1/3]

core::domain::Contract::Contract ( )
default
Here is the caller graph for this function:

◆ Contract() [2/3]

core::domain::Contract::Contract ( const Contract & )
delete
Here is the call graph for this function:

◆ Contract() [3/3]

core::domain::Contract::Contract ( Contract && )
delete
Here is the call graph for this function:

Member Function Documentation

◆ actorCount()

std::size_t core::domain::Contract::actorCount ( ) const
nodiscardnoexcept

Returns the number of linked actors.

Returns
Actor relation count.

Definition at line 160 of file Contract.cpp.

◆ actorIds()

const std::vector< std::string > & core::domain::Contract::actorIds ( ) const
nodiscardnoexcept

Definition at line 188 of file Contract.cpp.

◆ addActorId()

void core::domain::Contract::addActorId ( std::string value)

Adds an actor id when it is not already present.

Parameters
valueActor id to add.

Definition at line 49 of file Contract.cpp.

Here is the call graph for this function:

◆ addAlias()

void core::domain::Contract::addAlias ( Alias value)

Adds a normalized alias when it is not already present.

Parameters
valueAlias to add.

Definition at line 93 of file Contract.cpp.

Here is the call graph for this function:

◆ addPropertyId()

void core::domain::Contract::addPropertyId ( std::string value)

Adds a property id when it is not already present.

Parameters
valueProperty id to add.

Definition at line 71 of file Contract.cpp.

Here is the call graph for this function:

◆ aliasCount()

std::size_t core::domain::Contract::aliasCount ( ) const
nodiscardnoexcept

Returns the number of aliases.

Returns
Alias count.

Definition at line 118 of file Contract.cpp.

◆ aliases()

const std::vector< Alias > & core::domain::Contract::aliases ( ) const
nodiscardnoexcept

Definition at line 190 of file Contract.cpp.

◆ allocatableMode()

const std::string & core::domain::Contract::allocatableMode ( ) const
nodiscardnoexcept

Definition at line 187 of file Contract.cpp.

◆ clearActorIds()

void core::domain::Contract::clearActorIds ( )

Clears all linked actor ids.

Definition at line 62 of file Contract.cpp.

◆ clearAliases()

void core::domain::Contract::clearAliases ( )

Clears all aliases from the contract.

Definition at line 126 of file Contract.cpp.

◆ clearPropertyIds()

void core::domain::Contract::clearPropertyIds ( )

Clears all linked property ids.

Definition at line 84 of file Contract.cpp.

◆ containsActorId()

bool core::domain::Contract::containsActorId ( const std::string & value) const
nodiscard

Checks whether an actor id exists.

Parameters
valueActor id to search for.
Returns
true when the actor id exists.

Definition at line 130 of file Contract.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ containsPropertyId()

bool core::domain::Contract::containsPropertyId ( const std::string & value) const
nodiscard

Checks whether a property id exists.

Parameters
valueProperty id to search for.
Returns
true when the property id exists.

Definition at line 135 of file Contract.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createdAt()

const std::string & core::domain::Contract::createdAt ( ) const
nodiscardnoexcept

Definition at line 191 of file Contract.cpp.

◆ hasActorRelations()

bool core::domain::Contract::hasActorRelations ( ) const
nodiscardnoexcept

Checks whether any actor relations exist.

Returns
true when at least one actor id is linked.

Definition at line 144 of file Contract.cpp.

◆ hasAlias()

bool core::domain::Contract::hasAlias ( const std::string & value) const
nodiscard

Checks whether an alias exists on the contract.

Parameters
valueAlias text to search for.
Returns
true when the alias exists.

Definition at line 114 of file Contract.cpp.

Here is the call graph for this function:

◆ hasAliases()

bool core::domain::Contract::hasAliases ( ) const
nodiscardnoexcept

Checks whether the contract has any aliases.

Returns
true when at least one alias exists.

Definition at line 122 of file Contract.cpp.

Here is the caller graph for this function:

◆ hasName()

bool core::domain::Contract::hasName ( ) const
nodiscardnoexcept

Checks whether the contract has a name.

Returns
true when the name is set.

Definition at line 110 of file Contract.cpp.

Here is the caller graph for this function:

◆ hasPropertyRelations()

bool core::domain::Contract::hasPropertyRelations ( ) const
nodiscardnoexcept

Checks whether any property relations exist.

Returns
true when at least one property id is linked.

Definition at line 148 of file Contract.cpp.

◆ hasRelations()

bool core::domain::Contract::hasRelations ( ) const
nodiscardnoexcept

Checks whether the contract has any relations.

Returns
true when actor or property relations exist.

Definition at line 152 of file Contract.cpp.

Here is the caller graph for this function:

◆ hasSingleActor()

bool core::domain::Contract::hasSingleActor ( ) const
nodiscardnoexcept

Checks whether the contract has exactly one actor.

Returns
true when exactly one actor id is linked.

Definition at line 140 of file Contract.cpp.

◆ hasType()

bool core::domain::Contract::hasType ( ) const
nodiscardnoexcept

Checks whether the contract has a type.

Returns
true when the type is set.

Definition at line 168 of file Contract.cpp.

Here is the caller graph for this function:

◆ id()

const std::string & core::domain::Contract::id ( ) const
nodiscardnoexcept

Definition at line 184 of file Contract.cpp.

◆ isConfigured()

bool core::domain::Contract::isConfigured ( ) const
nodiscardnoexcept

Checks whether the contract is fully configured.

Returns
true when both name and type are set.

Definition at line 172 of file Contract.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isMatchingReady()

bool core::domain::Contract::isMatchingReady ( ) const
nodiscardnoexcept

Checks whether the contract is ready for matching.

Returns
true when the contract is configured and has aliases.

Definition at line 176 of file Contract.cpp.

Here is the call graph for this function:

◆ isStandalone()

bool core::domain::Contract::isStandalone ( ) const
nodiscardnoexcept

Checks whether the contract has no actor or property links.

Returns
true when the contract is standalone.

Definition at line 180 of file Contract.cpp.

Here is the call graph for this function:

◆ name()

const std::string & core::domain::Contract::name ( ) const
nodiscardnoexcept

Definition at line 185 of file Contract.cpp.

◆ operator=() [1/2]

Contract & core::domain::Contract::operator= ( const Contract & )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

Contract & core::domain::Contract::operator= ( Contract && )
delete
Here is the call graph for this function:

◆ propertyCount()

std::size_t core::domain::Contract::propertyCount ( ) const
nodiscardnoexcept

Returns the number of linked properties.

Returns
Property relation count.

Definition at line 164 of file Contract.cpp.

◆ propertyIds()

const std::vector< std::string > & core::domain::Contract::propertyIds ( ) const
nodiscardnoexcept

Definition at line 189 of file Contract.cpp.

◆ recordAliasHit()

void core::domain::Contract::recordAliasHit ( std::string value,
std::string timestamp = {} )

Records a usage hit for an alias.

Parameters
valueAlias value.
timestampOptional usage timestamp.

Definition at line 106 of file Contract.cpp.

Here is the call graph for this function:

◆ relationCount()

std::size_t core::domain::Contract::relationCount ( ) const
nodiscardnoexcept

Returns the total number of linked relations.

Returns
Number of actor and property relations.

Definition at line 156 of file Contract.cpp.

◆ removeActorId()

void core::domain::Contract::removeActorId ( const std::string & value)

Removes an actor id from the contract.

Parameters
valueActor id to remove.

Definition at line 57 of file Contract.cpp.

Here is the call graph for this function:

◆ removeAlias()

void core::domain::Contract::removeAlias ( std::string value)

Removes an alias.

Parameters
valueAlias to remove.

Definition at line 101 of file Contract.cpp.

Here is the call graph for this function:

◆ removePropertyId()

void core::domain::Contract::removePropertyId ( const std::string & value)

Removes a property id from the contract.

Parameters
valueProperty id to remove.

Definition at line 79 of file Contract.cpp.

Here is the call graph for this function:

◆ rename() [1/2]

void core::domain::Contract::rename ( EntityName value)

Renames the contract with normalized entity text.

Parameters
valueNormalized entity name wrapper.

Definition at line 16 of file Contract.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rename() [2/2]

void core::domain::Contract::rename ( std::string value)

Renames the contract with raw text.

Parameters
valueRaw entity name text.

Definition at line 20 of file Contract.cpp.

Here is the call graph for this function:

◆ setActorIds()

void core::domain::Contract::setActorIds ( std::vector< std::string > value)

Replaces the linked actor ids with normalized values.

Parameters
valueActor id list to store.

Definition at line 44 of file Contract.cpp.

◆ setAliases()

void core::domain::Contract::setAliases ( std::vector< Alias > value)

Definition at line 88 of file Contract.cpp.

Here is the call graph for this function:

◆ setAllocatableMode()

void core::domain::Contract::setAllocatableMode ( std::string value)

Definition at line 32 of file Contract.cpp.

Here is the call graph for this function:

◆ setCreatedAt()

void core::domain::Contract::setCreatedAt ( std::string value)

Definition at line 194 of file Contract.cpp.

◆ setId()

void core::domain::Contract::setId ( std::string value)

Definition at line 193 of file Contract.cpp.

◆ setPropertyIds()

void core::domain::Contract::setPropertyIds ( std::vector< std::string > value)

Replaces the linked property ids with normalized values.

Parameters
valueProperty id list to store.

Definition at line 66 of file Contract.cpp.

◆ setType() [1/2]

void core::domain::Contract::setType ( ContractType value)

Sets the contract type from a normalized value object.

Parameters
valueNormalized contract type wrapper.

Definition at line 24 of file Contract.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setType() [2/2]

void core::domain::Contract::setType ( std::string value)

Sets the contract type from raw text.

Parameters
valueRaw contract type text.

Definition at line 28 of file Contract.cpp.

Here is the call graph for this function:

◆ setUpdatedAt()

void core::domain::Contract::setUpdatedAt ( std::string value)

Definition at line 195 of file Contract.cpp.

◆ type()

const std::string & core::domain::Contract::type ( ) const
nodiscardnoexcept

Definition at line 186 of file Contract.cpp.

◆ updatedAt()

const std::string & core::domain::Contract::updatedAt ( ) const
nodiscardnoexcept

Definition at line 192 of file Contract.cpp.


The documentation for this class was generated from the following files: