]> sigrok.org Git - libsigrok.git/blobdiff - bindings/cxx/include/libsigrok/libsigrok.hpp
C++: Rename StructureWrapper to ParentOwned.
[libsigrok.git] / bindings / cxx / include / libsigrok / libsigrok.hpp
index 6260858274ade8db0a9aff8fa62fc6ea7a67ebb4..0c77c9069c0e3c61cb3932b9004cfbf9bae80e45 100644 (file)
@@ -124,9 +124,9 @@ public:
        const char *what() const throw();
 };
 
-/* Base template for most classes which wrap a struct type from libsigrok. */
+/* Base template for classes whose resources are owned by a parent object. */
 template <class Class, class Parent, typename Struct>
-class SR_API StructureWrapper
+class SR_API ParentOwned
 {
 protected:
        /*  Parent object which owns this child object's underlying structure.
@@ -186,7 +186,7 @@ protected:
 
        Struct *structure;
 
-       StructureWrapper<Class, Parent, Struct>(Struct *structure) :
+       ParentOwned<Class, Parent, Struct>(Struct *structure) :
                structure(structure)
        {
        }
@@ -262,7 +262,7 @@ protected:
 
 /** A hardware driver provided by the library */
 class SR_API Driver :
-       public StructureWrapper<Driver, Context, struct sr_dev_driver>
+       public ParentOwned<Driver, Context, struct sr_dev_driver>
 {
 public:
        /** Name of this driver. */
@@ -352,7 +352,7 @@ protected:
 
 /** A real hardware device, connected via a driver */
 class SR_API HardwareDevice :
-       public StructureWrapper<HardwareDevice, Context, struct sr_dev_inst>,
+       public ParentOwned<HardwareDevice, Context, struct sr_dev_inst>,
        public Device
 {
 public:
@@ -369,7 +369,7 @@ protected:
 
 /** A channel on a device */
 class SR_API Channel :
-       public StructureWrapper<Channel, Device, struct sr_channel>
+       public ParentOwned<Channel, Device, struct sr_channel>
 {
 public:
        /** Current name of this channel. */
@@ -398,7 +398,7 @@ protected:
 
 /** A group of channels on a device, which share some configuration */
 class SR_API ChannelGroup :
-       public StructureWrapper<ChannelGroup, Device, struct sr_channel_group>,
+       public ParentOwned<ChannelGroup, Device, struct sr_channel_group>,
        public Configurable
 {
 public:
@@ -441,7 +441,7 @@ protected:
 
 /** A stage in a trigger configuration */
 class SR_API TriggerStage :
-       public StructureWrapper<TriggerStage, Trigger, struct sr_trigger_stage>
+       public ParentOwned<TriggerStage, Trigger, struct sr_trigger_stage>
 {
 public:
        /** Index number of this stage. */
@@ -466,7 +466,7 @@ protected:
 
 /** A match condition in a trigger configuration  */
 class SR_API TriggerMatch :
-       public StructureWrapper<TriggerMatch, TriggerStage, struct sr_trigger_match>
+       public ParentOwned<TriggerMatch, TriggerStage, struct sr_trigger_match>
 {
 public:
        /** Channel this condition matches on. */
@@ -682,7 +682,7 @@ protected:
 
 /** Payload of a datafeed header packet */
 class SR_API Header :
-       public StructureWrapper<Header, Packet, const struct sr_datafeed_header>,
+       public ParentOwned<Header, Packet, const struct sr_datafeed_header>,
        public PacketPayload
 {
 public:
@@ -699,7 +699,7 @@ protected:
 
 /** Payload of a datafeed metadata packet */
 class SR_API Meta :
-       public StructureWrapper<Meta, Packet, const struct sr_datafeed_meta>,
+       public ParentOwned<Meta, Packet, const struct sr_datafeed_meta>,
        public PacketPayload
 {
 public:
@@ -715,7 +715,7 @@ protected:
 
 /** Payload of a datafeed packet with logic data */
 class SR_API Logic :
-       public StructureWrapper<Logic, Packet, const struct sr_datafeed_logic>,
+       public ParentOwned<Logic, Packet, const struct sr_datafeed_logic>,
        public PacketPayload
 {
 public:
@@ -734,7 +734,7 @@ protected:
 
 /** Payload of a datafeed packet with analog data */
 class SR_API Analog :
-       public StructureWrapper<Analog, Packet, const struct sr_datafeed_analog>,
+       public ParentOwned<Analog, Packet, const struct sr_datafeed_analog>,
        public PacketPayload
 {
 public:
@@ -759,7 +759,7 @@ protected:
 
 /** An input format supported by the library */
 class SR_API InputFormat :
-       public StructureWrapper<InputFormat, Context, const struct sr_input_module>
+       public ParentOwned<InputFormat, Context, const struct sr_input_module>
 {
 public:
        /** Name of this input format. */
@@ -806,7 +806,7 @@ protected:
 
 /** A virtual device associated with an input */
 class SR_API InputDevice :
-       public StructureWrapper<InputDevice, Input, struct sr_dev_inst>,
+       public ParentOwned<InputDevice, Input, struct sr_dev_inst>,
        public Device
 {
 protected:
@@ -857,7 +857,7 @@ protected:
 
 /** An output format supported by the library */
 class SR_API OutputFormat :
-       public StructureWrapper<OutputFormat, Context, const struct sr_output_module>
+       public ParentOwned<OutputFormat, Context, const struct sr_output_module>
 {
 public:
        /** Name of this output format. */