1
0
Files
irix-657m-src/eoe/cmd/mediad/Inventory.H
2022-09-29 17:59:04 +03:00

46 lines
913 B
C++

#ifndef Inventory_included
#define Inventory_included
// An Inventory object presents the relevant part of the H/W
// inventory as an indexable, searchable array. The inventory is
// read once, and a single copy is held, and all the objects refer to
// it.
//
// The only inventory records that are held are those that can
// be translated to a valid DeviceAddress.
#include "bool.H"
class DeviceAddress;
struct inventory_s;
class Inventory {
public:
// Use default constructors and destructor
inline unsigned count() const;
const inventory_s *operator [] (unsigned) const;
const inventory_s *at(const DeviceAddress&) const;
private:
static bool _initialized;
static unsigned _ninv;
static inventory_s *_invp;
static void init();
};
inline unsigned
Inventory::count() const
{
if (!_initialized)
init();
return _ninv;
}
#endif /* !Inventory_included */