Overview   API Reference  

device_descriptors< DeviceT > Struct Template Reference

Struct to register which function instantiates which device (factory pattern). More...

#include <devices.hpp>

Collaboration diagram for device_descriptors< DeviceT >:

Collaboration graph
[legend]

List of all members.

Public Types

enum  flags_constants { SINGLETON = 0x01, ALL_MASK = SINGLETON }
 Flags to define special treatment for machine_base::create_device. More...
typedef DeviceT device_type
typedef device_type *(* create_func_ptr )(machine_base &, config_node &)
typedef int(* multi_create_func_ptr )(vector< device_type * > &, machine_base &, config_node &)
typedef bitmask< typename
uint_value_t< ALL_MASK|L4VMM_ALL_MASK >
::least > 
flags
typedef map< string, descriptorcollection_type

Public Member Functions

 static_assert (integer_traits< typename flags::word_type >::const_max >=(ALL_MASK|L4VMM_ALL_MASK),"flags's max value is too small")
template<>
device_descriptors< device > & instance
template<>
device_descriptors< pci_device > & instance

Static Public Member Functions

static const descriptorget (const string &name)
static int register_device (const string &name, const descriptor &descriptor)
static void print (const char *header=nullptr)

Protected Attributes

collection_type descriptors
 Internal non-static collection to store the information.

Static Protected Attributes

static device_descriptorsinstance
 Instance (reference) this template instantiation belongs to (singleton pattern).

Classes

struct  descriptor
 One descriptor to be stored in a collection. More...


Detailed Description

template<typename DeviceT = void>
struct device_descriptors< DeviceT >

Struct to register which function instantiates which device (factory pattern).

Note: All instances of devices with flag SINGLETON shall return the same name when name() is called !


Member Enumeration Documentation

template<typename DeviceT = void>
enum device_descriptors::flags_constants

Flags to define special treatment for machine_base::create_device.

Currently unused.

Enumerator:
SINGLETON  can have at most 1 instance
ALL_MASK  Mask containing all used bits.


The documentation for this struct was generated from the following files:

L4vmm Reference Manual, written by Mario Schwalbe  © 2006-2008