You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section explains how to use derived classes to produce extensible programs.
11
10
12
11
## Overview
13
12
14
-
New classes can be derived from existing classes using a mechanism called "inheritance" (see the information beginning in [Single Inheritance](../cpp/single-inheritance.md)). Classes that are used for derivation are called "base classes" of a particular derived class. A derived class is declared using the following syntax:
13
+
New classes can be derived from existing classes using a mechanism called "inheritance" (see the information beginning in [Single Inheritance](single-inheritance.md)). Classes that are used for derivation are called "base classes" of a particular derived class. A derived class is declared using the following syntax:
15
14
16
15
```cpp
17
-
classDerived : [virtual][access-specifier] Base
16
+
classDerivedSingleBase : [virtual][access-specifier] Base
After the tag (name) for the class, a colon appears followed by a list of base specifications. The base classes so named must have been declared previously. The base specifications may contain an access specifier, which is one of the keywords **`public`**, **`protected`** or **`private`**. These access specifiers appear before the base class name and apply only to that base class. These specifiers control the derived class's permission to use to members of the base class. See [Member-Access Control](../cpp/member-access-control-cpp.md) for information on access to base class members. If the access specifier is omitted, the access to that base is considered **`private`**. The base specifications may contain the keyword **`virtual`** to indicate virtual inheritance. This keyword may appear before or after the access specifier, if any. If virtual inheritance is used, the base class is referred to as a virtual base class.
28
+
After the tag (name) for the class, a colon appears followed by a list of base specifications. The base classes so named must have been declared previously. The base specifications may contain an access specifier, which is one of the keywords [**`public`**](public-cpp.md), [**`protected`**](protected-cpp.md) or [**`private`**](private-cpp.md). These access specifiers appear before the base class name and apply only to that base class. These specifiers control the derived class's permission to use members of the base class. See [Member-Access Control](member-access-control-cpp.md) for information on access to base class members. If the access specifier is omitted, the access to that base is considered **`private`**. The base specifications may contain the keyword [**`virtual`**](virtual-cpp.md) to indicate virtual inheritance. This keyword may appear before or after the access specifier, if any. If virtual inheritance is used, the base class is referred to as a virtual base class.
29
29
30
-
Multiple base classes can be specified, separated by commas. If a single base class is specified, the inheritance model is [Single inheritance](../cpp/single-inheritance.md). If more than one base class is specified, the inheritance model is called [Multiple inheritance](../cpp/multiple-base-classes.md).
30
+
Multiple base classes can be specified, separated by commas. If a single base class is specified, the inheritance model is [Single inheritance](single-inheritance.md). If more than one base class is specified, the inheritance model is called [Multiple inheritance](multiple-base-classes.md).
Copy file name to clipboardExpand all lines: docs/data/data-access-in-cpp.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Connect to Azure SQL Database from C or C++ applications.
31
31
[Azure Storage](/azure/storage/common/storage-introduction) is a cloud storage solution for modern applications that rely on durability, availability, and scalability to meet the needs of their customers. Connect to Azure Storage from C++ by using the Azure Storage Client Library for C++.
32
32
33
33
[ODBC Driver for SQL Server](/sql/connect/odbc/microsoft-odbc-driver-for-sql-server)<br/>
34
-
The latest ODBC driver provides robust data access to Microsoft SQL Server and Microsoft Azure SQL Database for C/C++ based applications. Provides support for features including always encrypted, Azure Active Directory, and AlwaysOn Availability Groups. Also available for MacOS and Linux.
34
+
The latest ODBC driver provides robust data access to Microsoft SQL Server and Microsoft Azure SQL Database for C/C++ based applications. Provides support for features including always encrypted, Azure Active Directory, and AlwaysOn Availability Groups. Also available for macOS and Linux.
35
35
36
36
[OLE DB Driver for SQL Server](/sql/connect/oledb/oledb-driver-for-sql-server)<br/>
37
37
The latest OLE DB driver is a stand-alone data access application programming interface (API) that supports Microsoft SQL Server and Microsoft Azure SQL Database.
@@ -13,17 +12,17 @@ A `transformer` messaging block is a single-target, multi-source, ordered `propa
13
12
## Syntax
14
13
15
14
```cpp
16
-
template<class_Input, class _Output>
15
+
template<class_Input, class _Output>
17
16
class transformer : public propagator_block<single_link_registry<ITarget<_Output>>,
18
17
multi_link_registry<ISource<_Input>>>;
19
18
```
20
19
21
20
### Parameters
22
21
23
-
*_Input*<br/>
22
+
*`_Input`*\
24
23
The payload type of the messages accepted by the buffer.
25
24
26
-
*_Output*<br/>
25
+
*`_Output`*\
27
26
The payload type of the messages stored and propagated out by the buffer.
28
27
29
28
## Members
@@ -32,27 +31,27 @@ The payload type of the messages stored and propagated out by the buffer.
32
31
33
32
|Name|Description|
34
33
|----------|-----------------|
35
-
|[transformer](#ctor)|Overloaded. Constructs a `transformer` messaging block.|
36
-
|[~transformer Destructor](#dtor)|Destroys the `transformer` messaging block.|
34
+
|[`transformer`](#ctor)|Overloaded. Constructs a `transformer` messaging block.|
35
+
|[`~transformer`](#dtor)|Destroys the `transformer` messaging block.|
37
36
38
37
### Protected Methods
39
38
40
39
|Name|Description|
41
40
|----------|-----------------|
42
-
|[accept_message](#accept_message)|Accepts a message that was offered by this `transformer` messaging block, transferring ownership to the caller.|
43
-
|[consume_message](#consume_message)|Consumes a message previously offered by the `transformer` and reserved by the target, transferring ownership to the caller.|
44
-
|[link_target_notification](#link_target_notification)|A callback that notifies that a new target has been linked to this `transformer` messaging block.|
45
-
|[propagate_message](#propagate_message)|Asynchronously passes a message from an `ISource` block to this `transformer` messaging block. It is invoked by the `propagate` method, when called by a source block.|
46
-
|[propagate_to_any_targets](#propagate_to_any_targets)|Executes the transformer function on the input messages.|
47
-
|[release_message](#release_message)|Releases a previous message reservation. (Overrides [source_block::release_message](source-block-class.md#release_message).)|
48
-
|[reserve_message](#reserve_message)|Reserves a message previously offered by this `transformer` messaging block. (Overrides [source_block::reserve_message](source-block-class.md#reserve_message).)|
49
-
|[resume_propagation](#resume_propagation)|Resumes propagation after a reservation has been released. (Overrides [source_block::resume_propagation](source-block-class.md#resume_propagation).)|
50
-
|[send_message](#send_message)|Synchronously passes a message from an `ISource` block to this `transformer` messaging block. It is invoked by the `send` method, when called by a source block.|
51
-
|[supports_anonymous_source](#supports_anonymous_source)|Overrides the `supports_anonymous_source` method to indicate that this block can accept messages offered to it by a source that is not linked. (Overrides [ITarget::supports_anonymous_source](itarget-class.md#supports_anonymous_source).)|
41
+
|[`accept_message`](#accept_message)|Accepts a message that was offered by this `transformer` messaging block, transferring ownership to the caller.|
42
+
|[`consume_message`](#consume_message)|Consumes a message previously offered by the `transformer` and reserved by the target, transferring ownership to the caller.|
43
+
|[`link_target_notification`](#link_target_notification)|A callback that notifies that a new target has been linked to this `transformer` messaging block.|
44
+
|[`propagate_message`](#propagate_message)|Asynchronously passes a message from an `ISource` block to this `transformer` messaging block. It is invoked by the `propagate` method, when called by a source block.|
45
+
|[`propagate_to_any_targets`](#propagate_to_any_targets)|Executes the transformer function on the input messages.|
46
+
|[`release_message`](#release_message)|Releases a previous message reservation. (Overrides [`source_block::release_message`](source-block-class.md#release_message).)|
47
+
|[`reserve_message`](#reserve_message)|Reserves a message previously offered by this `transformer` messaging block. (Overrides [`source_block::reserve_message`](source-block-class.md#reserve_message).)|
48
+
|[`resume_propagation`](#resume_propagation)|Resumes propagation after a reservation has been released. (Overrides [`source_block::resume_propagation`](source-block-class.md#resume_propagation).)|
49
+
|[`send_message`](#send_message)|Synchronously passes a message from an `ISource` block to this `transformer` messaging block. It is invoked by the `send` method, when called by a source block.|
50
+
|[`supports_anonymous_source`](#supports_anonymous_source)|Overrides the `supports_anonymous_source` method to indicate that this block can accept messages offered to it by a source that is not linked. (Overrides [`ITarget::supports_anonymous_source`](itarget-class.md#supports_anonymous_source).)|
52
51
53
52
## Remarks
54
53
55
-
For more information, see [Asynchronous Message Blocks](../../../parallel/concrt/asynchronous-message-blocks.md).
54
+
For more information, see [Asynchronous Message Blocks](../asynchronous-message-blocks.md).
56
55
57
56
## Inheritance Hierarchy
58
57
@@ -72,7 +71,7 @@ For more information, see [Asynchronous Message Blocks](../../../parallel/concrt
72
71
73
72
**Namespace:** concurrency
74
73
75
-
## <a name="accept_message"></a> accept_message
74
+
## <a name="accept_message"></a> `accept_message`
76
75
77
76
Accepts a message that was offered by this `transformer` messaging block, transferring ownership to the caller.
Asynchronously passes a message from an `ISource` block to this `transformer` messaging block. It is invoked by the `propagate` method, when called by a source block.
Resumes propagation after a reservation has been released.
188
187
189
188
```cpp
190
189
virtualvoidresume_propagation();
191
190
```
192
191
193
-
## <aname="send_message"></a> send_message
192
+
## <aname="send_message"></a> `send_message`
194
193
195
194
Synchronously passes a message from an `ISource` block to this `transformer` messaging block. It is invoked by the `send` method, when called by a source block.
**`true`** because the block does not postpone offered messages.
226
225
227
-
## <aname="ctor"></a> transformer
226
+
## <aname="ctor"></a> `transformer`
228
227
229
228
Constructs a `transformer` messaging block.
230
229
@@ -263,19 +262,19 @@ transformer(
263
262
264
263
### Parameters
265
264
266
-
*_Func*<br/>
265
+
*`_Func`*\
267
266
A function that will be invoked for each accepted message.
268
267
269
-
*_PTarget*<br/>
268
+
*`_PTarget`*\
270
269
A pointer to a target block to link with the transformer.
271
270
272
-
*_Filter*<br/>
271
+
*`_Filter`*\
273
272
A filter function which determines whether offered messages should be accepted.
274
273
275
-
*_PScheduler*<br/>
274
+
*`_PScheduler`*\
276
275
The `Scheduler` object within which the propagation task for the `transformer` messaging block is scheduled.
277
276
278
-
*_PScheduleGroup*<br/>
277
+
*`_PScheduleGroup`*\
279
278
The `ScheduleGroup` object within which the propagation task for the `transformer` messaging block is scheduled. The `Scheduler` object used is implied by the schedule group.
280
279
281
280
### Remarks
@@ -286,7 +285,7 @@ The type `_Transform_method` is a functor with signature `_Output (_Input const
286
285
287
286
The type `filter_method` is a functor with signature `bool (_Input const &)` which is invoked by this `transformer` messaging block to determine whether or not it should accept an offered message.
288
287
289
-
## <a name="dtor"></a> ~transformer
288
+
## <a name="dtor"></a> `~transformer`
290
289
291
290
Destroys the `transformer` messaging block.
292
291
@@ -296,5 +295,5 @@ Destroys the `transformer` messaging block.
0 commit comments