Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F28201990
Unit.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
Unit.h
View Options
/*******************************************************************************
*
* File: Unit.h
*
* Contents: Declaration of Unit base-class.
*
* Copyright 2017
*
* Author: David Juhasz (david.juhasz@tuwien.ac.at)
*
******************************************************************************/
#ifndef ROSA_CORE_UNIT_H
#define ROSA_CORE_UNIT_H
#include
<ostream>
#include
<string>
namespace
rosa
{
// Forward declarations.
class
System
;
// Base class for every entity in the system that has to be identified and
// traced.
// NOTE: Life-cycle of Unit instances is supposed to be managed by a System, do
// not create and destroy a Unit directly.
class
Unit
{
public
:
// System-assigned unique identifier of the Unit instance,
// based on the static member field CountUnits.
const
size_t
Id
;
// Textual identifier of the Unit instance. Defaults to a text referring to
// the Id value of the Unit, unless otherwise defined via a constructor
// argument. The Name of a Unit is not necessarily unique in the system.
const
std
::
string
Name
;
protected
:
// The owning System.
System
&
S
;
public
:
// Full qualified name of the Unit instance.
const
std
::
string
FullName
;
public
:
// Ctor.
Unit
(
const
size_t
Id
,
const
std
::
string
&
Name
,
System
&
S
)
noexcept
;
// No copy and move.
Unit
(
const
Unit
&
)
=
delete
;
Unit
(
Unit
&&
)
=
delete
;
Unit
&
operator
=
(
const
Unit
&
)
=
delete
;
Unit
&
operator
=
(
Unit
&&
)
=
delete
;
// Dtor.
virtual
~
Unit
(
void
);
// Returns a reference to the owning System.
// NOTE: Subclasses may override the function to return a reference of a
// special System subtype.
virtual
System
&
system
()
const
noexcept
;
// Dumping the object into a string for tracing purposes,
// subclasses are supposed to override this function.
virtual
std
::
string
dump
(
void
)
const
noexcept
;
};
// Helper function dumping the given Unit instance to the given output stream.
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
Unit
&
U
);
}
// End namespace rosa
#endif
// ROSA_CORE_UNIT_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Fri, Nov 20, 9:14 PM (3 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
415731
Default Alt Text
Unit.h (2 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline