ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Fields | Public Methods | Private Fields | Private Methods | List of all members
ScopeInfo Class Reference
Collaboration diagram for ScopeInfo:
[legend]

Class Description


Encapsulates information of the caller that can be collected. This is platform specific, in this case, .NET 4.5. What we currently can get from the .NET compiler, is the source file name of the calling code, the line number within the source file name and the name of the method the call is placed. We do not get the class name of the object or even its instance.

Public Fields

HashMap< Long, String > threadDictionary = new HashMap<Long, String>()
 
Ticks timeStamp = new Ticks()
 

Public Methods

 ScopeInfo (String name, Vector< String > omittablePackagePrefixes)
 
AString getClassName ()
 
AString getFileName ()
 
int getLineNumber ()
 
String getLoxName ()
 
AString getMethodName ()
 
AString getPackageName ()
 
Thread getThread ()
 
long getThreadID ()
 
AString getThreadName ()
 
void release ()
 
void set (Thread thread)
 

Private Fields

AString className = new AString(32)
 
AString fileName = new AString(32)
 
boolean lazyStackTrace = true
 
int lineNumber
 
String loxName
 
AString methodName = new AString(32)
 
Vector< String > omittablePackagePrefixes
 
AString packageName = new AString(32)
 
Thread thread
 
AString threadName = new AString(32)
 

Private Methods

void updateStackTrace ()
 

Constructor & Destructor Documentation

◆ ScopeInfo()

ScopeInfo ( String  name,
Vector< String >  omittablePackagePrefixes 
)

Constructs a scope info.

Parameters
nameThe name of the Lox we belong to. Will be converted to upper case.
omittablePackagePrefixesA list of prefixes of package names that are ignored, when the calling method is identified from the top of the calling stack.

Member Function Documentation

◆ getClassName()

AString getClassName ( )

Receives the callees class name.

Returns
The callees class name.

◆ getFileName()

AString getFileName ( )

Receives the callees file name.

Returns
The callees file name.

◆ getLineNumber()

int getLineNumber ( )

Receives the callees line number.

Returns
The callees line number.

◆ getLoxName()

String getLoxName ( )

Receives the name of the Lox we are belonging to (this is a 1:1 relationship).

Returns
The name of the Lox.

◆ getMethodName()

AString getMethodName ( )

Receives the callees method name.

Returns
The callees method name.

◆ getPackageName()

AString getPackageName ( )

Receives the callees package name.

Returns
The callees package name.

◆ getThread()

Thread getThread ( )

Receives the ID of the thread executing the scope.

Returns
The name of the thread.

◆ getThreadID()

long getThreadID ( )

Receives the ID of the thread executing the scope.

Returns
The name of the thread.

◆ getThreadName()

AString getThreadName ( )

Receives the name of the thread executing the scope. If a mapping exists, the mapped name is returned

Returns
The name of the thread.

◆ release()

void release ( )

Releases latest scope information.

◆ set()

void set ( Thread  thread)

Stores parameters and sets actual time stamp.

Parameters
threadThe thread executing a log statement. If null, it will be determined if needed.

◆ updateStackTrace()

void updateStackTrace ( )
private

Retrieves the scope information from a stack trace when field lazyStackTrace is true.

Member Data Documentation

◆ className

AString className = new AString(32)
private

Name of the method the log call is placed in.

◆ fileName

AString fileName = new AString(32)
private

Name of the source code file the log call is placed in.

◆ lazyStackTrace

boolean lazyStackTrace = true
private

Flag that indicates whether stack trace information was retrieved already (false) or not (true).

◆ lineNumber

int lineNumber
private

The line number within the source file where the log call is placed in.

◆ loxName

String loxName
private

The name of the Lox we are attached to

◆ methodName

AString methodName = new AString(32)
private

Name of the method the log call is placed in.

◆ omittablePackagePrefixes

Vector<String> omittablePackagePrefixes
private

A reference to list of prefixes of 'packages.classes.methods' maintained by our lox

◆ packageName

AString packageName = new AString(32)
private

Name and path of the source code file the log call is placed in.

◆ thread

Thread thread
private

The thread that invoked the call.

◆ threadDictionary

HashMap<Long, String> threadDictionary = new HashMap<Long, String>()

Dictionary to translate thread IDs into something maybe nicer/shorter. The dictionary may be filled by the user of the library using Lox.mapThreadName.

◆ threadName

AString threadName = new AString(32)
private

Name and path of the source code file the log call is placed in.

◆ timeStamp

Ticks timeStamp = new Ticks()

Time of the call represented by this instance.


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