#include <GlobalDefinitions.h>
Collaboration diagram for MachineInfo:

Public Member Functions | |
| int | getNumBits (void) |
| bool | getIsLeastSigByteFirst (void) |
| void | report (ostream &os) |
Static Public Member Functions | |
| static MachineInfo * | getInfo (void) |
Protected Member Functions | |
| MachineInfo (void) | |
Private Types | |
| typedef unsigned long | Offset |
Private Attributes | |
| int | numBits_ |
| bool | isLeastSigByteFirst_ |
Static Private Attributes | |
| static MachineInfo * | info_ = 0 |
Friends | |
| ostream & | operator<< (ostream &os, MachineInfo &myInfo) |
Definition at line 392 of file GlobalDefinitions.h.
typedef unsigned long MachineInfo::Offset [private] |
Definition at line 394 of file GlobalDefinitions.h.
| MachineInfo::MachineInfo | ( | void | ) | [inline, protected] |
Definition at line 418 of file GlobalDefinitions.h.
References isLeastSigByteFirst_, and numBits_.
00419 { 00420 00421 numBits_ = 8 * sizeof(Offset); 00422 00423 Offset checkByteOrder = 1; 00424 Offset* offsetAddress = &checkByteOrder; 00425 char* firstByte = ( (char*) offsetAddress ); 00426 00427 offsetAddress++; 00428 char* lastByte = (char*) offsetAddress; 00429 lastByte--; 00430 isLeastSigByteFirst_ = ( *firstByte == 1 ); 00431 00432 } // ~constructor
| static MachineInfo* MachineInfo::getInfo | ( | void | ) | [inline, static] |
Definition at line 396 of file GlobalDefinitions.h.
References info_.
Referenced by processQuery().
00397 { 00398 if ( info_ == 0 ) info_ = new MachineInfo; 00399 return info_; 00400 } // ~getInfo
Here is the caller graph for this function:

| int MachineInfo::getNumBits | ( | void | ) | [inline] |
| bool MachineInfo::getIsLeastSigByteFirst | ( | void | ) | [inline] |
Definition at line 403 of file GlobalDefinitions.h.
References isLeastSigByteFirst_.
00403 { return isLeastSigByteFirst_; }
| void MachineInfo::report | ( | ostream & | os | ) | [inline] |
Definition at line 404 of file GlobalDefinitions.h.
References isLeastSigByteFirst_, and numBits_.
00405 { 00406 os << "This is a " << numBits_ << " bit machine with " 00407 << ( (isLeastSigByteFirst_) ? "least" : "most" ) 00408 << "-significant-byte-first ordering" << endl; 00409 } // ~report
| ostream& operator<< | ( | ostream & | os, | |
| MachineInfo & | myInfo | |||
| ) | [friend] |
Definition at line 411 of file GlobalDefinitions.h.
00412 { 00413 myInfo.report(os); 00414 return os; 00415 }
MachineInfo * MachineInfo::info_ = 0 [static, private] |
int MachineInfo::numBits_ [private] |
Definition at line 436 of file GlobalDefinitions.h.
Referenced by getNumBits(), MachineInfo(), and report().
bool MachineInfo::isLeastSigByteFirst_ [private] |
Definition at line 437 of file GlobalDefinitions.h.
Referenced by getIsLeastSigByteFirst(), MachineInfo(), and report().
1.5.2