# cxxUnion

The <cxxUnion> element provides the name of the C++ API union, all the elements necessary to describe the members that are introduced by the union declaration.

## Description

The <cxxUnion> element requires an ID attribute as an anchor point; this ID must always be specified. The ID attribute is referenced by the conref attribute and internal applications that refer to the <cxxUnion> element content. The elements <apiName> and <cxxUnionDetail> are required for this top-level container.

## Example

    <cxxUnion id="union_comms_packer_1_1_t_union">
    	<apiName>CommsFW::TCFLegacyMessagePacker::TUnion</apiName>
    	<cxxUnionDetail>
    		<cxxUnionDefinition>
    			<cxxUnionAccessSpecifier value="private"/>
    			<cxxUnionAPIItemLocation>
    				<cxxUnionDeclarationFile name="filePath" value="C:/src/include/elements/cftransportmsg.h"/>
    				<cxxUnionDeclarationFileLine name="lineNumber" value="59"/>
    				<cxxUnionDefinitionFile name="filePath" value="C:/src/include/elements/cftransportmsg.h"/>
    				<cxxUnionDefinitionFileLineStart name="lineNumber" value="58"/>
    				<cxxUnionDefinitionFileLineEnd name="lineNumber" value="70"/>
    			</cxxUnionAPIItemLocation>
    		</cxxUnionDefinition>
    		<apiDesc/>
    	</cxxUnionDetail>
    	<cxxUnionNested>
    		<cxxUnionNestedDetail>
    			<cxxUnionNestedStruct href="struct_comms_package.xml#struct_package">CommsFW::TCFLegacyMessagePacker::TUnion::TLegacyPackage</cxxUnionNestedStruct>
    			<cxxUnionNestedStruct href="struct_comms_package.xml#struct_package">CommsFW::TCFLegacyMessagePacker::TUnion::TPackage</cxxUnionNestedStruct>
    		</cxxUnionNestedDetail>
    	</cxxUnionNested>
    </cxxUnion>

## Contained by

## Contains

apiName, cxxDefine cxxEnumeration cxxFunction cxxTypedef cxxUnionDetail cxxUnionNested cxxVariable prolog, related-links, shortdesc,

## Content Model

(apiName, then shortdesc, then prolog, then cxxUnionDetail then related-links, then ((cxxUnionNested or cxxFunction or cxxDefine or cxxVariable or cxxEnumeration or cxxTypedef (any number) ) ))

## Inheritance

topic/topic reference/reference apiRef/apiRef apiClassifier/apiClassifier cxxUnion/cxxUnion

Parent topic: cxxUnion module