~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/emu/device.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
struct rom_entry;
96
96
class machine_config;
97
97
class emu_timer;
98
 
typedef struct _input_device_default input_device_default;
 
98
struct input_device_default;
99
99
 
100
100
 
101
101
 
124
124
typedef void (*write_line_device_func)(device_t *device, int state);
125
125
 
126
126
 
127
 
 
128
127
// ======================> device_t
129
128
 
130
129
// device_t represents a device
165
164
        const rom_entry *rom_region() const { return device_rom_region(); }
166
165
        machine_config_constructor machine_config_additions() const { return device_mconfig_additions(); }
167
166
        ioport_constructor input_ports() const { return device_input_ports(); }
 
167
        UINT8 default_bios() const { return m_default_bios; }
 
168
        UINT8 system_bios() const { return m_system_bios; }
168
169
 
169
170
        // interface helpers
170
171
        template<class _DeviceClass> bool interface(_DeviceClass *&intf) { intf = dynamic_cast<_DeviceClass *>(this); return (intf != NULL); }
184
185
        device_t *first_subdevice() const { return m_subdevice_list.first(); }
185
186
        astring &subtag(astring &dest, const char *tag) const;
186
187
        astring &siblingtag(astring &dest, const char *tag) const { return (this != NULL && m_owner != NULL) ? m_owner->subtag(dest, tag) : dest.cpy(tag); }
187
 
        const memory_region *subregion(const char *tag) const;
 
188
        memory_region *memregion(const char *tag) const;
 
189
        memory_share *memshare(const char *tag) const;
 
190
        memory_bank *membank(const char *tag) const;
 
191
        ioport_port *ioport(const char *tag) const;
188
192
        device_t *subdevice(const char *tag) const;
189
193
        device_t *siblingdevice(const char *tag) const;
190
194
        template<class _DeviceClass> inline _DeviceClass *subdevice(const char *tag) const { return downcast<_DeviceClass *>(subdevice(tag)); }
191
195
        template<class _DeviceClass> inline _DeviceClass *siblingdevice(const char *tag) const { return downcast<_DeviceClass *>(siblingdevice(tag)); }
192
 
        const memory_region *region() const { return m_region; }
 
196
        memory_region *region() const { return m_region; }
193
197
 
194
198
        // configuration helpers
195
199
        static void static_set_clock(device_t &device, UINT32 clock);
227
231
        // debugging
228
232
        device_debug *debug() const { return m_debug; }
229
233
 
 
234
        void set_default_bios(UINT8 bios) { m_default_bios = bios; }
 
235
        void set_system_bios(UINT8 bios) { m_system_bios = bios; }
230
236
protected:
 
237
        // internal helper classes (defined below)
 
238
        class finder_base;
 
239
        template<class _ObjectClass> class object_finder_base;
 
240
        template<class _DeviceClass, bool _Required> class device_finder;
 
241
        template<class _DeviceClass> class optional_device;
 
242
        template<class _DeviceClass> class required_device;
 
243
        template<bool _Required> class memory_region_finder;
 
244
        class optional_memory_region;
 
245
        class required_memory_region;
 
246
        template<bool _Required> class memory_bank_finder;
 
247
        class optional_memory_bank;
 
248
        class required_memory_bank;
 
249
        template<bool _Required> class ioport_finder;
 
250
        class optional_ioport;
 
251
        class required_ioport;
 
252
        template<typename _PointerType, bool _Required> class shared_ptr_finder;
 
253
        template<typename _PointerType> class optional_shared_ptr;
 
254
        template<typename _PointerType> class required_shared_ptr;
 
255
        template<typename _PointerType, int _Count, bool _Required> class shared_ptr_array_finder;
 
256
        template<typename _PointerType, int _Count> class optional_shared_ptr_array;
 
257
        template<typename _PointerType, int _Count> class required_shared_ptr_array;
 
258
 
231
259
        // miscellaneous helpers
232
260
        void set_machine(running_machine &machine);
233
261
        void start();
236
264
        void pre_save();
237
265
        void post_load();
238
266
        void notify_clock_changed();
 
267
        finder_base *register_auto_finder(finder_base &autodev);
239
268
 
240
269
        //------------------- begin derived class overrides
241
270
 
283
312
        attoseconds_t                   m_attoseconds_per_clock;// period in attoseconds
284
313
 
285
314
        device_debug *                  m_debug;
286
 
        const memory_region *   m_region;                               // our device-local region
 
315
        memory_region *                 m_region;                               // our device-local region
287
316
        const machine_config &  m_machine_config;               // reference to the machine's configuration
288
317
        const void *                    m_static_config;                // static device configuration
289
318
        const input_device_default *m_input_defaults;   // devices input ports default overrides
290
319
 
291
 
        // helper class to request auto-object discovery in the constructor of a derived class
292
 
        class auto_finder_base
293
 
        {
294
 
        public:
295
 
                // construction/destruction
296
 
                auto_finder_base(device_t &base, const char *tag);
297
 
                virtual ~auto_finder_base();
298
 
 
299
 
                // getters
300
 
                virtual void findit(device_t &base) = 0;
301
 
 
302
 
                // helpers
303
 
                device_t *find_device(device_t &device, const char *tag);
304
 
                void *find_shared_ptr(device_t &device, const char *tag);
305
 
                size_t find_shared_size(device_t &device, const char *tag);
306
 
 
307
 
                // internal state
308
 
                auto_finder_base *m_next;
309
 
                const char *m_tag;
310
 
        };
311
 
 
312
 
        // templated version bound to a specific type
313
 
        template<typename _TargetType, bool _Required>
314
 
        class auto_finder_type : public auto_finder_base
315
 
        {
316
 
        public:
317
 
                // construction/destruction
318
 
                auto_finder_type(device_t &base, const char *tag)
319
 
                        : auto_finder_base(base, tag),
320
 
                          m_target(0) { }
321
 
 
322
 
                // operators to make use transparent
323
 
                operator _TargetType() { return m_target; }
324
 
                operator _TargetType() const { return m_target; }
325
 
                _TargetType operator->() { return m_target; }
326
 
 
327
 
                // getter for explicit fetching
328
 
                _TargetType target() const { return m_target; }
329
 
 
330
 
                // setter for setting the object
331
 
                void set_target(_TargetType target)
332
 
                {
333
 
                        m_target = target;
334
 
                        if (target == 0 && _Required)
335
 
                                throw emu_fatalerror("Unable to find required object '%s'", this->m_tag);
336
 
                }
337
 
 
338
 
                // internal state
339
 
                _TargetType m_target;
340
 
        };
341
 
 
342
 
        // optional device finder
343
 
        template<class _DeviceClass>
344
 
        class optional_device : public auto_finder_type<_DeviceClass *, false>
345
 
        {
346
 
        public:
347
 
                optional_device(device_t &base, const char *tag) : auto_finder_type<_DeviceClass *, false>(base, tag) { }
348
 
                virtual void findit(device_t &base) { this->set_target(downcast<_DeviceClass *>(this->find_device(base, this->m_tag))); }
349
 
        };
350
 
 
351
 
        // required devices are similar but throw an error if they are not found
352
 
        template<class _DeviceClass>
353
 
        class required_device : public auto_finder_type<_DeviceClass *, true>
354
 
        {
355
 
        public:
356
 
                required_device(device_t &base, const char *tag) : auto_finder_type<_DeviceClass *, true>(base, tag) { }
357
 
                virtual void findit(device_t &base) { this->set_target(downcast<_DeviceClass *>(this->find_device(base, this->m_tag))); }
358
 
        };
359
 
 
360
 
        // optional shared pointer finder
361
 
        template<typename _PointerType>
362
 
        class optional_shared_ptr : public auto_finder_type<_PointerType *, false>
363
 
        {
364
 
        public:
365
 
                optional_shared_ptr(device_t &base, const char *tag) : auto_finder_type<_PointerType *, false>(base, tag) { }
366
 
                virtual void findit(device_t &base) { this->set_target(reinterpret_cast<_PointerType *>(this->find_shared_ptr(base, this->m_tag))); }
367
 
        };
368
 
 
369
 
        // required shared pointer finder
370
 
        template<typename _PointerType>
371
 
        class required_shared_ptr : public auto_finder_type<_PointerType *, true>
372
 
        {
373
 
        public:
374
 
                required_shared_ptr(device_t &base, const char *tag) : auto_finder_type<_PointerType *, true>(base, tag) { }
375
 
                virtual void findit(device_t &base) { this->set_target(reinterpret_cast<_PointerType *>(this->find_shared_ptr(base, this->m_tag))); }
376
 
        };
377
 
 
378
 
        // optional shared pointer size finder
379
 
        class optional_shared_size : public auto_finder_type<size_t, false>
380
 
        {
381
 
        public:
382
 
                optional_shared_size(device_t &base, const char *tag) : auto_finder_type<size_t, false>(base, tag) { }
383
 
                virtual void findit(device_t &base) { this->set_target(find_shared_size(base, this->m_tag)); }
384
 
        };
385
 
 
386
 
        // required shared pointer size finder
387
 
        class required_shared_size : public auto_finder_type<size_t, true>
388
 
        {
389
 
        public:
390
 
                required_shared_size(device_t &base, const char *tag) : auto_finder_type<size_t, true>(base, tag) { }
391
 
                virtual void findit(device_t &base) { this->set_target(find_shared_size(base, this->m_tag)); }
392
 
        };
393
 
 
394
 
        // internal helpers
395
 
        void register_auto_finder(auto_finder_base &autodev);
396
 
 
397
 
        auto_finder_base *              m_auto_finder_list;
398
 
 
 
320
        UINT8                                   m_system_bios;                  // the system BIOS we wish to load
 
321
        UINT8                                   m_default_bios;                 // the default system BIOS
399
322
private:
400
323
        // private helpers
401
324
        device_t *add_subdevice(device_type type, const char *tag, UINT32 clock);
410
333
        astring                                 m_basetag;                              // base part of the tag
411
334
        bool                                    m_config_complete;              // have we completed our configuration?
412
335
        bool                                    m_started;                              // true if the start function has succeeded
413
 
};
414
 
 
 
336
        finder_base *                   m_auto_finder_list;             // list of objects to auto-find
 
337
};
 
338
 
 
339
 
 
340
// ======================> finder_base
 
341
 
 
342
// helper class to request auto-object discovery in the constructor of a derived class
 
343
class device_t::finder_base
 
344
{
 
345
        friend class device_t;
 
346
 
 
347
public:
 
348
        // construction/destruction
 
349
        finder_base(device_t &base, const char *tag);
 
350
        virtual ~finder_base();
 
351
 
 
352
        // getters
 
353
        virtual bool findit() = 0;
 
354
 
 
355
protected:
 
356
        // helpers
 
357
        void *find_memory(UINT8 width, size_t &bytes, bool required);
 
358
        bool report_missing(bool found, const char *objname, bool required);
 
359
 
 
360
        // internal state
 
361
        finder_base *m_next;
 
362
        device_t &m_base;
 
363
        const char *m_tag;
 
364
};
 
365
 
 
366
 
 
367
// ======================> object_finder_base
 
368
 
 
369
// helper class to find objects of a particular type
 
370
template<class _ObjectClass>
 
371
class device_t::object_finder_base : public device_t::finder_base
 
372
{
 
373
public:
 
374
        // construction/destruction
 
375
        object_finder_base(device_t &base, const char *tag)
 
376
                : finder_base(base, tag),
 
377
                  m_target(NULL) { }
 
378
 
 
379
        // operators to make use transparent
 
380
        operator _ObjectClass *() const { return m_target; }
 
381
        _ObjectClass *operator->() const { assert(m_target != NULL); return m_target; }
 
382
 
 
383
        // getter for explicit fetching
 
384
        _ObjectClass *target() const { return m_target; }
 
385
 
 
386
        // setter for setting the object
 
387
        void set_target(_ObjectClass *target) { m_target = target; }
 
388
 
 
389
protected:
 
390
        // internal state
 
391
        _ObjectClass *m_target;
 
392
};
 
393
 
 
394
 
 
395
// ======================> device_finder
 
396
 
 
397
// device finder template
 
398
template<class _DeviceClass, bool _Required>
 
399
class device_t::device_finder : public device_t::object_finder_base<_DeviceClass>
 
400
{
 
401
public:
 
402
        // construction/destruction
 
403
        device_finder(device_t &base, const char *tag)
 
404
                : object_finder_base<_DeviceClass>(base, tag) { }
 
405
 
 
406
        // finder
 
407
        virtual bool findit()
 
408
        {
 
409
                device_t *device = this->m_base.subdevice(this->m_tag);
 
410
                this->m_target = dynamic_cast<_DeviceClass *>(device);
 
411
                if (device != NULL && this->m_target == NULL)
 
412
                {
 
413
                        void mame_printf_warning(const char *format, ...) ATTR_PRINTF(1,2);
 
414
                        mame_printf_warning("Device '%s' found but is of incorrect type\n", this->m_tag);
 
415
                }
 
416
                return this->report_missing(this->m_target != NULL, "device", _Required);
 
417
        }
 
418
};
 
419
 
 
420
// optional device finder
 
421
template<class _DeviceClass>
 
422
class device_t::optional_device : public device_t::device_finder<_DeviceClass, false>
 
423
{
 
424
public:
 
425
        optional_device(device_t &base, const char *tag) : device_finder<_DeviceClass, false>(base, tag) { }
 
426
};
 
427
 
 
428
// required devices are similar but throw an error if they are not found
 
429
template<class _DeviceClass>
 
430
class device_t::required_device : public device_t::device_finder<_DeviceClass, true>
 
431
{
 
432
public:
 
433
        required_device(device_t &base, const char *tag) : device_finder<_DeviceClass, true>(base, tag) { }
 
434
};
 
435
 
 
436
 
 
437
// ======================> memregion_finder
 
438
 
 
439
// device finder template
 
440
template<bool _Required>
 
441
class device_t::memory_region_finder : public device_t::object_finder_base<memory_region>
 
442
{
 
443
public:
 
444
        // construction/destruction
 
445
        memory_region_finder(device_t &base, const char *tag)
 
446
                : object_finder_base<memory_region>(base, tag) { }
 
447
 
 
448
        // finder
 
449
        virtual bool findit()
 
450
        {
 
451
                m_target = m_base.memregion(m_tag);
 
452
                return this->report_missing(m_target != NULL, "memory region", _Required);
 
453
        }
 
454
};
 
455
 
 
456
// optional device finder
 
457
class device_t::optional_memory_region : public device_t::memory_region_finder<false>
 
458
{
 
459
public:
 
460
        optional_memory_region(device_t &base, const char *tag) : memory_region_finder<false>(base, tag) { }
 
461
};
 
462
 
 
463
// required devices are similar but throw an error if they are not found
 
464
class device_t::required_memory_region : public device_t::memory_region_finder<true>
 
465
{
 
466
public:
 
467
        required_memory_region(device_t &base, const char *tag) : memory_region_finder<true>(base, tag) { }
 
468
};
 
469
 
 
470
 
 
471
// ======================> memory_bank_finder
 
472
 
 
473
// device finder template
 
474
template<bool _Required>
 
475
class device_t::memory_bank_finder : public device_t::object_finder_base<memory_bank>
 
476
{
 
477
public:
 
478
        // construction/destruction
 
479
        memory_bank_finder(device_t &base, const char *tag)
 
480
                : object_finder_base<memory_bank>(base, tag) { }
 
481
 
 
482
        // finder
 
483
        virtual bool findit()
 
484
        {
 
485
                m_target = m_base.membank(m_tag);
 
486
                return this->report_missing(m_target != NULL, "memory bank", _Required);
 
487
        }
 
488
};
 
489
 
 
490
// optional device finder
 
491
class device_t::optional_memory_bank : public device_t::memory_bank_finder<false>
 
492
{
 
493
public:
 
494
        optional_memory_bank(device_t &base, const char *tag) : memory_bank_finder<false>(base, tag) { }
 
495
};
 
496
 
 
497
// required devices are similar but throw an error if they are not found
 
498
class device_t::required_memory_bank : public device_t::memory_bank_finder<true>
 
499
{
 
500
public:
 
501
        required_memory_bank(device_t &base, const char *tag) : memory_bank_finder<true>(base, tag) { }
 
502
};
 
503
 
 
504
 
 
505
// ======================> ioport_finder
 
506
 
 
507
// device finder template
 
508
template<bool _Required>
 
509
class device_t::ioport_finder : public device_t::object_finder_base<ioport_port>
 
510
{
 
511
public:
 
512
        // construction/destruction
 
513
        ioport_finder(device_t &base, const char *tag)
 
514
                : object_finder_base<ioport_port>(base, tag) { }
 
515
 
 
516
        // finder
 
517
        virtual bool findit()
 
518
        {
 
519
                m_target = m_base.ioport(m_tag);
 
520
                return this->report_missing(m_target != NULL, "I/O port", _Required);
 
521
        }
 
522
};
 
523
 
 
524
// optional device finder
 
525
class device_t::optional_ioport : public device_t::ioport_finder<false>
 
526
{
 
527
public:
 
528
        optional_ioport(device_t &base, const char *tag) : ioport_finder<false>(base, tag) { }
 
529
};
 
530
 
 
531
// required devices are similar but throw an error if they are not found
 
532
class device_t::required_ioport : public device_t::ioport_finder<true>
 
533
{
 
534
public:
 
535
        required_ioport(device_t &base, const char *tag) : ioport_finder<true>(base, tag) { }
 
536
};
 
537
 
 
538
 
 
539
// ======================> shared_ptr_finder
 
540
 
 
541
// shared pointer finder template
 
542
template<typename _PointerType, bool _Required>
 
543
class device_t::shared_ptr_finder : public device_t::object_finder_base<_PointerType>
 
544
{
 
545
public:
 
546
        // construction/destruction
 
547
        shared_ptr_finder(device_t &base, const char *tag, UINT8 width = sizeof(_PointerType) * 8)
 
548
                : object_finder_base<_PointerType>(base, tag),
 
549
                  m_bytes(0),
 
550
                  m_allocated(false),
 
551
                  m_width(width) { }
 
552
 
 
553
        virtual ~shared_ptr_finder() { if (m_allocated) global_free(this->m_target); }
 
554
 
 
555
        // operators to make use transparent
 
556
        _PointerType operator[](int index) const { return this->m_target[index]; }
 
557
        _PointerType &operator[](int index) { return this->m_target[index]; }
 
558
 
 
559
        // getter for explicit fetching
 
560
        UINT32 bytes() const { return m_bytes; }
 
561
 
 
562
        // setter for setting the object
 
563
        void set_target(_PointerType *target, size_t bytes) { this->m_target = target; m_bytes = bytes; }
 
564
 
 
565
        // dynamic allocation of a shared pointer
 
566
        void allocate(UINT32 entries)
 
567
        {
 
568
                assert(!m_allocated);
 
569
                m_allocated = true;
 
570
                this->m_target = global_alloc_array_clear(_PointerType, entries);
 
571
                m_bytes = entries * sizeof(_PointerType);
 
572
                this->m_base.save_pointer(this->m_target, this->m_tag, entries);
 
573
        }
 
574
 
 
575
        // finder
 
576
        virtual bool findit()
 
577
        {
 
578
                this->m_target = reinterpret_cast<_PointerType *>(this->find_memory(m_width, m_bytes, _Required));
 
579
                return this->report_missing(this->m_target != NULL, "shared pointer", _Required);
 
580
        }
 
581
 
 
582
protected:
 
583
        // internal state
 
584
        size_t m_bytes;
 
585
        bool m_allocated;
 
586
        UINT8 m_width;
 
587
};
 
588
 
 
589
// optional shared pointer finder
 
590
template<class _PointerType>
 
591
class device_t::optional_shared_ptr : public device_t::shared_ptr_finder<_PointerType, false>
 
592
{
 
593
public:
 
594
        optional_shared_ptr(device_t &base, const char *tag, UINT8 width = sizeof(_PointerType) * 8) : shared_ptr_finder<_PointerType, false>(base, tag, width) { }
 
595
};
 
596
 
 
597
// required shared pointer finder
 
598
template<class _PointerType>
 
599
class device_t::required_shared_ptr : public device_t::shared_ptr_finder<_PointerType, true>
 
600
{
 
601
public:
 
602
        required_shared_ptr(device_t &base, const char *tag, UINT8 width = sizeof(_PointerType) * 8) : shared_ptr_finder<_PointerType, true>(base, tag, width) { }
 
603
};
 
604
 
 
605
 
 
606
// ======================> shared_ptr_array_finder
 
607
 
 
608
// shared pointer array finder template
 
609
template<typename _PointerType, int _Count, bool _Required>
 
610
class device_t::shared_ptr_array_finder
 
611
{
 
612
        typedef shared_ptr_finder<_PointerType, _Required> shared_ptr_type;
 
613
 
 
614
public:
 
615
        // construction/destruction
 
616
        shared_ptr_array_finder(device_t &base, const char *basetag, UINT8 width = sizeof(_PointerType) * 8)
 
617
        {
 
618
                for (int index = 0; index < _Count; index++)
 
619
                        m_array[index] = global_alloc(shared_ptr_type(base, m_tag[index].format("%s.%d", basetag, index), width));
 
620
        }
 
621
 
 
622
        virtual ~shared_ptr_array_finder()
 
623
        {
 
624
                for (int index = 0; index < _Count; index++)
 
625
                        global_free(m_array[index]);
 
626
        }
 
627
 
 
628
        // array accessors
 
629
        const shared_ptr_type &operator[](int index) const { assert(index < _Count); return *m_array[index]; }
 
630
        shared_ptr_type &operator[](int index) { assert(index < _Count); return *m_array[index]; }
 
631
 
 
632
protected:
 
633
        // internal state
 
634
        shared_ptr_type *m_array[_Count];
 
635
        astring m_tag[_Count];
 
636
};
 
637
 
 
638
// optional shared pointer array finder
 
639
template<class _PointerType, int _Count>
 
640
class device_t::optional_shared_ptr_array : public device_t::shared_ptr_array_finder<_PointerType, _Count, false>
 
641
{
 
642
public:
 
643
        optional_shared_ptr_array(device_t &base, const char *tag, UINT8 width = sizeof(_PointerType) * 8) : shared_ptr_array_finder<_PointerType, _Count, false>(base, tag, width) { }
 
644
};
 
645
 
 
646
// required shared pointer array finder
 
647
template<class _PointerType, int _Count>
 
648
class device_t::required_shared_ptr_array : public device_t::shared_ptr_array_finder<_PointerType, _Count, true>
 
649
{
 
650
public:
 
651
        required_shared_ptr_array(device_t &base, const char *tag, UINT8 width = sizeof(_PointerType) * 8) : shared_ptr_array_finder<_PointerType, _Count, true>(base, tag, width) { }
 
652
};
415
653
 
416
654
 
417
655
// ======================> device_interface
689
927
};
690
928
 
691
929
 
692
 
// ======================> device_delegate
693
 
 
694
 
// device_delegate is a delegate that wraps with a device tag and can be easily
695
 
// late bound without replicating logic everywhere
696
 
template<typename _Signature>
697
 
class device_delegate : public delegate<_Signature>
698
 
{
699
 
        typedef delegate<_Signature> basetype;
700
 
 
701
 
public:
702
 
        // provide same set of constructors as the base class, with additional device name
703
 
        // parameter
704
 
        device_delegate() : basetype(), m_device_name(NULL) { }
705
 
        device_delegate(const basetype &src) : basetype(src), m_device_name(src.m_device_name) { }
706
 
        device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), m_device_name(src.m_device_name) { }
707
 
        template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
708
 
        template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), m_device_name(devname) { }
709
 
        device_delegate(typename basetype::template traits<device_t>::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
710
 
        device_delegate(typename basetype::template traits<device_t>::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), m_device_name(NULL) { }
711
 
        device_delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
712
 
 
713
 
        // perform the binding
714
 
        void bind_relative_to(device_t &search_root);
715
 
 
716
 
private:
717
 
        // internal state
718
 
        const char *m_device_name;
719
 
};
720
 
 
721
 
 
722
930
 
723
931
//**************************************************************************
724
932
//  INLINE FUNCTIONS