GearEngine  0.0.1
Gear::Instrumentor 클래스 참조

#include <Instrumentor.h>

Gear::Instrumentor에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

 Instrumentor ()
 
void BeginSession (const std::string &name, const std::string &filepath="results.json")
 
void EndSession ()
 
void WriteProfile (const ProfileResult &result)
 
void WriteHeader ()
 
void WriteFooter ()
 

정적 Public 멤버 함수

static InstrumentorGet ()
 

Private 속성

InstrumentationSessionm_CurrentSession
 
std::ofstream m_OutputStream
 
int m_ProfileCount
 

상세한 설명

Instrumentor.h 파일의 24 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ Instrumentor()

Gear::Instrumentor::Instrumentor ( )
inline

Instrumentor.h 파일의 31 번째 라인에서 정의되었습니다.

32  : m_CurrentSession(nullptr), m_ProfileCount(0)
33  {
34  }

멤버 함수 문서화

◆ BeginSession()

void Gear::Instrumentor::BeginSession ( const std::string &  name,
const std::string &  filepath = "results.json" 
)
inline

Instrumentor.h 파일의 36 번째 라인에서 정의되었습니다.

37  {
38  m_OutputStream.open(filepath);
39  WriteHeader();
40  m_CurrentSession = new InstrumentationSession{ name };
41  }
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ EndSession()

void Gear::Instrumentor::EndSession ( )
inline

Instrumentor.h 파일의 43 번째 라인에서 정의되었습니다.

44  {
45  WriteFooter();
46  m_OutputStream.close();
47  delete m_CurrentSession;
48  m_CurrentSession = nullptr;
49  m_ProfileCount = 0;
50  }
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ Get()

static Instrumentor& Gear::Instrumentor::Get ( )
inlinestatic

Instrumentor.h 파일의 85 번째 라인에서 정의되었습니다.

86  {
87  static Instrumentor instance;
88  return instance;
89  }
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ WriteFooter()

void Gear::Instrumentor::WriteFooter ( )
inline

Instrumentor.h 파일의 79 번째 라인에서 정의되었습니다.

80  {
81  m_OutputStream << "]}";
82  m_OutputStream.flush();
83  }
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ WriteHeader()

void Gear::Instrumentor::WriteHeader ( )
inline

Instrumentor.h 파일의 73 번째 라인에서 정의되었습니다.

74  {
75  m_OutputStream << "{\"otherData\": {},\"traceEvents\":[";
76  m_OutputStream.flush();
77  }
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ WriteProfile()

void Gear::Instrumentor::WriteProfile ( const ProfileResult result)
inline

Instrumentor.h 파일의 52 번째 라인에서 정의되었습니다.

53  {
54  if (m_ProfileCount++ > 0)
55  m_OutputStream << ",";
56 
57  std::string name = result.Name;
58  std::replace(name.begin(), name.end(), '"', '\'');
59 
60  m_OutputStream << "{";
61  m_OutputStream << "\"cat\":\"function\",";
62  m_OutputStream << "\"dur\":" << (result.End - result.Start) << ',';
63  m_OutputStream << "\"name\":\"" << name << "\",";
64  m_OutputStream << "\"ph\":\"X\",";
65  m_OutputStream << "\"pid\":0,";
66  m_OutputStream << "\"tid\":" << result.ThreadID << ",";
67  m_OutputStream << "\"ts\":" << result.Start;
68  m_OutputStream << "}";
69 
70  m_OutputStream.flush();
71  }
이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ m_CurrentSession

InstrumentationSession* Gear::Instrumentor::m_CurrentSession
private

Instrumentor.h 파일의 27 번째 라인에서 정의되었습니다.

◆ m_OutputStream

std::ofstream Gear::Instrumentor::m_OutputStream
private

Instrumentor.h 파일의 28 번째 라인에서 정의되었습니다.

◆ m_ProfileCount

int Gear::Instrumentor::m_ProfileCount
private

Instrumentor.h 파일의 29 번째 라인에서 정의되었습니다.


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.:
Gear::Instrumentor::m_ProfileCount
int m_ProfileCount
Definition: Instrumentor.h:29
Gear::Instrumentor::m_CurrentSession
InstrumentationSession * m_CurrentSession
Definition: Instrumentor.h:27
Gear::Instrumentor::m_OutputStream
std::ofstream m_OutputStream
Definition: Instrumentor.h:28
Gear::Instrumentor::WriteFooter
void WriteFooter()
Definition: Instrumentor.h:79
Gear::Instrumentor::WriteHeader
void WriteHeader()
Definition: Instrumentor.h:73
Gear::Instrumentor::Instrumentor
Instrumentor()
Definition: Instrumentor.h:31