20 #define LIBSMBIOS_SOURCE
31 using namespace smbiosLowlevel;
34 #if defined(DEBUG_SMBIOS)
35 # define DCOUT(line) do { cout << line; } while(0)
36 # define DCERR(line) do { cerr << line; } while(0)
38 # define DCOUT(line) do {} while(0)
39 # define DCERR(line) do {} while(0)
45 ISmbiosTable::ISmbiosTable()
48 ISmbiosTable::~ISmbiosTable()
53 SmbiosTable::SmbiosTable ()
54 :
ISmbiosTable(), itemList(), initializing(true), strictValidationMode(false), workaround(0), smbiosBuffer (0)
65 :
ISmbiosTable(), itemList(), initializing(true), strictValidationMode(strictValidation), workaround(0), smbiosBuffer (0), strategyList(initStrategyList)
89 std::vector< SmbiosStrategy *>::iterator strategy;
108 throw InternalErrorImpl(
_(
"No null pointers should ever leak into the itemList"));
119 pair < const void *, ISmbiosItem * >myPair (ptr, &newitem);
155 throw NotImplementedImpl(
_(
"This is an enhanced function call that is not available in the base Smbios library. You must be using an enhanced library such as SmbiosXml to use this API"));
160 throw NotImplementedImpl(
_(
"This is an enhanced function call that is not available in the base Smbios library. You must be using an enhanced library such as SmbiosXml to use this API"));
165 bool gotTable =
false;
174 DCERR(
"calling strategy code to read table" << endl);
175 std::vector< SmbiosStrategy *>::iterator strategy;
180 DCERR(
" strategy: 0x" << hex << (
int)(*strategy) << endl);
183 DCERR(
" RETURNED SUCCESS" << endl);
193 DCERR(
"TABLE HEADER DUMP: " << endl << *
this << endl);
200 std::vector< SmbiosStrategy *>::iterator strategy;
205 throw InternalErrorImpl(
_(
"Could not instantiate SMBIOS table."));
218 std::auto_ptr<SmbiosWorkaroundTable> foo(
246 std::map < const void *, ISmbiosItem * >::iterator position;
248 position !=
itemList.end (); ++position)
250 delete position->second;
269 const void *header)
const
290 throw ItemNotFoundImpl(
"Could not de-reference a null item");
323 data =
reinterpret_cast<const u8 *
>(currStruct) + currStruct->
length;
365 cout <<
"\nSMBIOS table " << endl;
366 cout <<
"\tversion : ";
377 while (position !=
end())
379 cout << *position << endl;