ATLAS Offline Software
Loading...
Searching...
No Matches
Placement Class Reference

This class holds all the necessary information to guide the writing of an object in a physical place. More...

#include <Placement.h>

Collaboration diagram for Placement:

Public Member Functions

 Placement ()
 Default Constructor.
 Placement (const std::string &fileName, const std::string &containerName, long technology)
 Constructor with initialization.
const std::string & fileName () const
 Access file name.
PlacementsetFileName (const std::string &fileName)
 Set file name.
const std::string & containerName () const
 Access container name.
PlacementsetContainerName (const std::string &containerName)
 Set container name.
int technology () const
 Access technology type.
PlacementsetTechnology (int technology)
 Set technology type.
const std::string & auxString () const
 Access auxiliary string.
PlacementsetAuxString (std::string &&auxString)
 Set auxiliary string.
void setAuxString (std::string_view auxString)
const std::string toString () const
 Retrieve the string representation of the placement.
PlacementfromString (const std::string &from)
 Build from the string representation of a placement.

Private Attributes

long unsigned m_technology
 Technology identifier.
std::string m_fileName
 File name.
std::string m_containerName
 Container name.
std::string m_auxString
 Auxiliary string.

Detailed Description

This class holds all the necessary information to guide the writing of an object in a physical place.

Definition at line 20 of file Placement.h.

Constructor & Destructor Documentation

◆ Placement() [1/2]

Placement::Placement ( )

Default Constructor.

Definition at line 12 of file Placement.cxx.

13}
long unsigned m_technology
Technology identifier.
Definition Placement.h:53
std::string m_fileName
File name.
Definition Placement.h:55
std::string m_containerName
Container name.
Definition Placement.h:57

◆ Placement() [2/2]

Placement::Placement ( const std::string & fileName,
const std::string & containerName,
long technology )

Constructor with initialization.

Member Function Documentation

◆ auxString()

const std::string & Placement::auxString ( ) const
inline

Access auxiliary string.

Definition at line 41 of file Placement.h.

41{ return m_auxString; }
std::string m_auxString
Auxiliary string.
Definition Placement.h:59

◆ containerName()

const std::string & Placement::containerName ( ) const
inline

Access container name.

Definition at line 33 of file Placement.h.

33{ return m_containerName; }

◆ fileName()

const std::string & Placement::fileName ( ) const
inline

Access file name.

Definition at line 29 of file Placement.h.

29{ return m_fileName; }

◆ fromString()

Placement & Placement::fromString ( const std::string & from)

Build from the string representation of a placement.

Definition at line 28 of file Placement.cxx.

28 {
29 for (const char* p1 = source.c_str(); p1; p1 = ::strchr(++p1,'[')) {
30 const char* p2 = ::strchr(p1, '=');
31 const char* p3 = ::strchr(p1, ']');
32 if (p2 != 0 && p3 != 0) {
33 if (::strncmp("[FILE=", p1, 6) == 0) {
34 m_fileName.assign (p2+1, p3-p2-1);
35 } else if (::strncmp("[CONT=", p1, 6) == 0) {
36 m_containerName.assign (p2+1, p3-p2-1);
37 } else if (::strncmp(fmt_tech, p1, 6) == 0) {
38 ::sscanf(p1, fmt_tech, &m_technology);
39 } else {
40 while (*(p2 + 1) == '[' && p3 && *(++p3) != 0 && *p3 != ']') {
41 p3 = ::strchr(p3, ']');
42 }
43 if (!p3) p3 = source.c_str() + source.size();
44 m_auxString.append (p1, p3-p1);
45 m_auxString += ']';
46 }
47 }
48 }
49 return *this;
50}
static const char *const fmt_tech
Definition Placement.cxx:10

◆ setAuxString() [1/2]

Placement & Placement::setAuxString ( std::string && auxString)
inline

Set auxiliary string.

Definition at line 43 of file Placement.h.

43{ m_auxString = std::move(auxString); return *this; }
const std::string & auxString() const
Access auxiliary string.
Definition Placement.h:41

◆ setAuxString() [2/2]

void Placement::setAuxString ( std::string_view auxString)
inline

Definition at line 44 of file Placement.h.

◆ setContainerName()

Placement & Placement::setContainerName ( const std::string & containerName)
inline

Set container name.

Definition at line 35 of file Placement.h.

35{ m_containerName = containerName; return *this; }
const std::string & containerName() const
Access container name.
Definition Placement.h:33

◆ setFileName()

Placement & Placement::setFileName ( const std::string & fileName)
inline

Set file name.

Definition at line 31 of file Placement.h.

31{ m_fileName = fileName; return *this; }
const std::string & fileName() const
Access file name.
Definition Placement.h:29

◆ setTechnology()

Placement & Placement::setTechnology ( int technology)
inline

Set technology type.

Definition at line 39 of file Placement.h.

39{ m_technology = technology; return *this; }
int technology() const
Access technology type.
Definition Placement.h:37

◆ technology()

int Placement::technology ( ) const
inline

Access technology type.

Definition at line 37 of file Placement.h.

37{ return m_technology; }

◆ toString()

const std::string Placement::toString ( ) const

Retrieve the string representation of the placement.

Definition at line 15 of file Placement.cxx.

15 {
16 char text[128];
17 int s = sprintf(text, fmt_tech, m_technology);
18 std::string str = "[FILE=";
19 str += m_fileName;
20 str += "][CONT=";
22 str += ']';
23 str.append(text, s);
25 return str;
26}

Member Data Documentation

◆ m_auxString

std::string Placement::m_auxString
private

Auxiliary string.

Definition at line 59 of file Placement.h.

◆ m_containerName

std::string Placement::m_containerName
private

Container name.

Definition at line 57 of file Placement.h.

◆ m_fileName

std::string Placement::m_fileName
private

File name.

Definition at line 55 of file Placement.h.

◆ m_technology

long unsigned Placement::m_technology
private

Technology identifier.

Definition at line 53 of file Placement.h.


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