OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
TPEF::DataSymElement Class Reference

#include <DataSymElement.hh>

Inheritance diagram for TPEF::DataSymElement:
Inheritance graph
Collaboration diagram for TPEF::DataSymElement:
Collaboration graph

Public Member Functions

 DataSymElement ()
 
virtual ~DataSymElement ()
 
virtual SymbolType type () const
 
Chunkreference () const
 
void setReference (Chunk *aReference)
 
void setReference (const ReferenceManager::SafePointer *aReference)
 
Word size () const
 
void setSize (Word aSize)
 
- Public Member Functions inherited from TPEF::SymbolElement
 SymbolElement ()
 
virtual ~SymbolElement ()
 
bool absolute () const
 
void setAbsolute (bool anAbsoluteness)
 
SymbolBinding binding () const
 
void setBinding (SymbolBinding aBinding)
 
Chunkname () const
 
void setName (Chunk *aName)
 
void setName (const ReferenceManager::SafePointer *aName)
 
Sectionsection () const
 
void setSection (Section *aSect)
 
void setSection (const ReferenceManager::SafePointer *aSect)
 
- Public Member Functions inherited from TPEF::SectionElement
virtual ~SectionElement ()
 
- Public Member Functions inherited from TPEF::SafePointable
virtual ~SafePointable ()
 

Private Attributes

const ReferenceManager::SafePointerreference_
 Referred object. More...
 
Word size_
 Size of referred object in MAUs. More...
 

Additional Inherited Members

- Public Types inherited from TPEF::SymbolElement
enum  SymbolBinding { STB_LOCAL = 0x0, STB_GLOBAL = 0x1, STB_WEAK = 0x2 }
 Binding types of symbol. More...
 
enum  SymbolType {
  STT_NOTYPE = 0x0, STT_DATA = 0x1, STT_CODE = 0x2, STT_SECTION = 0x3,
  STT_FILE = 0x4, STT_PROCEDURE = 0x5
}
 Type of symbol element. More...
 
- Protected Member Functions inherited from TPEF::SectionElement
 SectionElement ()
 
- Protected Member Functions inherited from TPEF::SafePointable
 SafePointable ()
 

Detailed Description

Definition at line 41 of file DataSymElement.hh.

Constructor & Destructor Documentation

◆ DataSymElement()

TPEF::DataSymElement::DataSymElement ( )

Constructor.

Definition at line 43 of file DataSymElement.cc.

43  :
44  SymbolElement(),
46  size_(0) {
47 }

◆ ~DataSymElement()

TPEF::DataSymElement::~DataSymElement ( )
virtual

Destructor.

Definition at line 52 of file DataSymElement.cc.

52  {
53 }

Member Function Documentation

◆ reference()

Chunk * TPEF::DataSymElement::reference ( ) const

Returns object which element refers.

Returns
object which element refers.

Definition at line 71 of file DataSymElement.cc.

71  {
72  return dynamic_cast<Chunk*>(reference_->pointer());
73 }

References TPEF::ReferenceManager::SafePointer::pointer(), and reference_.

Referenced by TTAProgram::TPEFProgramFactory::createLabels(), TPEFDumper::section(), and TPEF::TPEFSymbolSectionWriter::writeValueAndSize().

Here is the call graph for this function:

◆ setReference() [1/2]

void TPEF::DataSymElement::setReference ( Chunk aReference)

Sets object which element refers.

Parameters
aReferenceObject which element refers.

Definition at line 81 of file DataSymElement.cc.

81  {
83 }

References reference_, and TPEF::ReferenceManager::SafePointer::replaceReference().

Referenced by TTAProgram::ProgramWriter::createBinary(), LabelManager::createSymbolWithReference(), and TPEF::AOutSymbolSectionReader::initializeSymbol().

Here is the call graph for this function:

◆ setReference() [2/2]

void TPEF::DataSymElement::setReference ( const ReferenceManager::SafePointer aReference)

Sets object which element refers.

Parameters
aReferenceObject which element refers.

Definition at line 91 of file DataSymElement.cc.

92  {
93  reference_ = aReference;
94 }

References reference_.

◆ setSize()

void TPEF::DataSymElement::setSize ( Word  aSize)

Sets size of referred object in MAUs.

Parameters
aSizeof the referred object in MAUs.

Definition at line 112 of file DataSymElement.cc.

112  {
113  size_ = aSize;
114 }

References size_.

Referenced by TPEF::AOutSymbolSectionReader::initializeSymbol().

◆ size()

Word TPEF::DataSymElement::size ( ) const

Returns size of the referred object in MAUs.

Returns
Size of the referred object in MAUs.

Definition at line 102 of file DataSymElement.cc.

102  {
103  return size_;
104 }

References size_.

Referenced by TPEF::TPEFSymbolSectionWriter::writeValueAndSize().

◆ type()

SymbolElement::SymbolType TPEF::DataSymElement::type ( ) const
virtual

Returns type of the element.

Returns
Type of the element.

Implements TPEF::SymbolElement.

Definition at line 61 of file DataSymElement.cc.

61  {
62  return STT_DATA;
63 }

References TPEF::SymbolElement::STT_DATA.

Member Data Documentation

◆ reference_

const ReferenceManager::SafePointer* TPEF::DataSymElement::reference_
private

Referred object.

Definition at line 57 of file DataSymElement.hh.

Referenced by reference(), and setReference().

◆ size_

Word TPEF::DataSymElement::size_
private

Size of referred object in MAUs.

Definition at line 59 of file DataSymElement.hh.

Referenced by setSize(), and size().


The documentation for this class was generated from the following files:
TPEF::ReferenceManager::SafePointer::replaceReference
static const SafePointer * replaceReference(const SafePointer *old, SafePointable *obj)
TPEF::DataSymElement::size_
Word size_
Size of referred object in MAUs.
Definition: DataSymElement.hh:59
TPEF::DataSymElement::reference_
const ReferenceManager::SafePointer * reference_
Referred object.
Definition: DataSymElement.hh:57
TPEF::ReferenceManager::SafePointer::null
static const SafePointer null
The default SafePointer that is used in null references.
Definition: SafePointer.hh:229
TPEF::SymbolElement::SymbolElement
SymbolElement()
Definition: SymbolElement.cc:46
TPEF::ReferenceManager::SafePointer::pointer
SafePointable * pointer() const
TPEF::SymbolElement::STT_DATA
@ STT_DATA
Associated with data object.
Definition: SymbolElement.hh:68