Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Identified.h
1// trax track library
2// AD 2016
3//
4// "Tough and Competent"
5//
6// Gene Kranz
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
29#include <string>
30#include <vector>
31
32namespace trax{
33
34 struct IDType;
35
40 template<class I>
41 struct Identified{
42
46 virtual const std::string& Reference( const std::string& name ) const = 0;
47
48
52 virtual void Reference( const std::string& name, const std::string& reference ) = 0;
53
54
56 virtual const std::vector<char const *>& ReferenceNames( const std::string& namePart ) const = 0;
57
58
60 virtual IDType ID() const noexcept = 0;
61
62
68 virtual void ID( IDType id ) noexcept = 0;
69
70
71 virtual ~Identified() = default;
72 Identified( const Identified& ) = delete; // if identified would copy, they would no longer be identified.
73 Identified& operator=( const Identified& ) = delete;
74 protected:
75 Identified() = default;
76 Identified( Identified&& ) = default;
77 Identified& operator=( Identified&& ) = default;
78 };
79
80}
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
Type used for IDs in the trax library.
Definition IDType.h:43
virtual IDType ID() const noexcept=0
virtual const std::vector< char const * > & ReferenceNames(const std::string &namePart) const =0
Searches for all reference names that countain namePart as substring in the name.
virtual const std::string & Reference(const std::string &name) const =0
Gets a reference that was set for this object by name.
virtual void Reference(const std::string &name, const std::string &reference)=0
Sets the reference for the object.