]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/arm-ds5-gator.git/blob - daemon/Driver.h
gator: Use for_each_kernel_tracepoint in Linux 3.15
[android-sdk/arm-ds5-gator.git] / daemon / Driver.h
1 /**
2  * Copyright (C) ARM Limited 2013-2014. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
9 #ifndef DRIVER_H
10 #define DRIVER_H
12 #include "mxml/mxml.h"
14 class Counter;
16 class Driver {
17 public:
18         static Driver *getHead() { return head; }
20         virtual ~Driver() {}
22         // Returns true if this driver can manage the counter
23         virtual bool claimCounter(const Counter &counter) const = 0;
24         // Clears and disables all counters
25         virtual void resetCounters() = 0;
26         // Enables and prepares the counter for capture
27         virtual void setupCounter(Counter &counter) = 0;
29         // Emits available counters
30         virtual int writeCounters(mxml_node_t *root) const = 0;
31         // Emits possible dynamically generated events/counters
32         virtual void writeEvents(mxml_node_t *) const {}
34         Driver *getNext() const { return next; }
36 protected:
37         Driver ();
39 private:
40         static Driver *head;
41         Driver *next;
43         // Intentionally unimplemented
44         Driver(const Driver &);
45         Driver &operator=(const Driver &);
46 };
48 #endif // DRIVER_H