\hypertarget{a00677_source}{}\doxysection{AAX\+\_\+\+CArray\+Data\+Buffer.\+h}
\label{a00677_source}\index{AAX\_CArrayDataBuffer.h@{AAX\_CArrayDataBuffer.h}}
\mbox{\hyperlink{a00677}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*================================================================================================*/}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ Copyright\ 2023\ Avid\ Technology,\ Inc.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ All\ rights\ reserved.}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ CONFIDENTIAL:\ this\ document\ contains\ confidential\ information\ of\ Avid.\ Do}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ not\ disclose\ to\ any\ third\ party.\ Use\ of\ the\ information\ contained\ in\ this}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *\ document\ is\ subject\ to\ an\ Avid\ SDK\ license.}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00016\ \textcolor{comment}{/*================================================================================================*/}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#ifndef\ AAX\_CArrayDataBuffer\_H}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ AAX\_CArrayDataBuffer\_H}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{a00569}{AAX\_IDataBuffer.h}}"{}}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{a00533}{AAX.h}}"{}}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#include\ <limits>}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#include\ <type\_traits>}}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00036\ \textcolor{keyword}{template}\ <AAX\_CTypeID\ T,\ \textcolor{keyword}{class}\ D>}
\DoxyCodeLine{00037\ \textcolor{keyword}{class\ }\mbox{\hyperlink{a01789}{AAX\_CArrayDataBufferOfType}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{a02205}{AAX\_IDataBuffer}}}
\DoxyCodeLine{00038\ \{}
\DoxyCodeLine{00039\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keyword}{explicit}\ \mbox{\hyperlink{a01789_a72b8b578eaad669ba1fe78f8a3f71a14}{AAX\_CArrayDataBufferOfType}}\ (std::vector<D>\ \textcolor{keyword}{const}\ \&\ inData)\ :\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keyword}{explicit}\ \mbox{\hyperlink{a01789_ada672844d5eb1949f958a5136a5a069d}{AAX\_CArrayDataBufferOfType}}\ (std::vector<D>\ \&\&\ inData)\ :\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \ \ \ \ \mbox{\hyperlink{a01789_aa80b2be99523ade6858e1b18df42ca2b}{AAX\_CArrayDataBufferOfType}}(\mbox{\hyperlink{a01789}{AAX\_CArrayDataBufferOfType}}\ \textcolor{keyword}{const}\ \&)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00044\ \ \ \ \ \mbox{\hyperlink{a01789_a2bf1231469c77f188efa2a3882057a87}{AAX\_CArrayDataBufferOfType}}(\mbox{\hyperlink{a01789}{AAX\_CArrayDataBufferOfType}}\ \&\&)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \ \ \ \ \mbox{\hyperlink{a01789_a002635d752359e3ba883c371dadc4a42}{\string~AAX\_CArrayDataBufferOfType}}\ (\textcolor{keywordtype}{void})\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00047\ \ \ \ \ }
\DoxyCodeLine{00048\ \ \ \ \ \mbox{\hyperlink{a01789}{AAX\_CArrayDataBufferOfType}}\&\ \mbox{\hyperlink{a01789_ad55db514efce91f61a37d4ed5485bd92}{operator=\ }}(\mbox{\hyperlink{a01789}{AAX\_CArrayDataBufferOfType}}\ \textcolor{keyword}{const}\ \&\ other)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00049\ \ \ \ \ \mbox{\hyperlink{a01789}{AAX\_CArrayDataBufferOfType}}\&\ \mbox{\hyperlink{a01789_ad55db514efce91f61a37d4ed5485bd92}{operator=\ }}(\mbox{\hyperlink{a01789}{AAX\_CArrayDataBufferOfType}}\ \&\&\ other)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00050\ }
\DoxyCodeLine{00051\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01789_aac1fdc33ff303837e921722abb7544b7}{Type}}(\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ *\ oType)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oType)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ *oType\ =\ T;}
\DoxyCodeLine{00054\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00055\ \ \ \ \ \}}
\DoxyCodeLine{00056\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01789_a01868ca5d28379d402746c0aca893133}{Size}}(int32\_t\ *\ oSize)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oSize)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \textcolor{keyword}{const}\ size\ =\ mData.size()\ *\ \textcolor{keyword}{sizeof}(D);}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_assert}(std::numeric\_limits<\textcolor{keyword}{decltype}(size)>::max()\ >=\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max(),}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}size\ variable\ may\ not\ represent\ all\ positive\ values\ of\ oSize"{}});}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (size\ >\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max())\ \{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937a5b3c0524765174acbb042f67edc0804a}{AAX\_ERROR\_SIGNED\_INT\_OVERFLOW}};}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00064\ \ \ \ \ \ \ \ \ *oSize\ =\ \textcolor{keyword}{static\_cast<}std::remove\_pointer<decltype(oSize)\textcolor{keyword}{>}::type>(size);}
\DoxyCodeLine{00065\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00066\ \ \ \ \ \}}
\DoxyCodeLine{00067\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01789_aba6313e19ad393fc8df576536c707fb0}{Data}}(\textcolor{keywordtype}{void}\ \textcolor{keyword}{const}\ **\ oBuffer)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00068\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oBuffer)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00069\ \ \ \ \ \ \ \ \ *oBuffer\ =\ mData.data();}
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00071\ \ \ \ \ \}}
\DoxyCodeLine{00072\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00073\ \ \ \ \ std::vector<D>\ \textcolor{keyword}{const}\ mData;}
\DoxyCodeLine{00074\ \};}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00079\ \textcolor{keyword}{template}\ <\textcolor{keyword}{class}\ D>}
\DoxyCodeLine{00080\ \textcolor{keyword}{class\ }\mbox{\hyperlink{a01793}{AAX\_CArrayDataBuffer}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{a02205}{AAX\_IDataBuffer}}}
\DoxyCodeLine{00081\ \{}
\DoxyCodeLine{00082\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00083\ \ \ \ \ \mbox{\hyperlink{a01793_acc1da2f4a98bb1f884b9f026ab2841fd}{AAX\_CArrayDataBuffer}}\ (\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ inType,\ std::vector<D>\ \textcolor{keyword}{const}\ \&\ inData)\ :\ mType\{inType\},\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00084\ \ \ \ \ \mbox{\hyperlink{a01793_ae3373ac3beeea10cba9d7c8b155a39e4}{AAX\_CArrayDataBuffer}}\ (\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ inType,\ std::vector<D>\ \&\&\ inData)\ :\ mType\{inType\},\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ \ \ \ \ \mbox{\hyperlink{a01793_ac5afc73acf4343f4362eb0605a72a6b5}{AAX\_CArrayDataBuffer}}(\mbox{\hyperlink{a01793}{AAX\_CArrayDataBuffer}}\ \textcolor{keyword}{const}\ \&)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00087\ \ \ \ \ \mbox{\hyperlink{a01793_ac81fb28f93a10f6a6e6b8ae7541a94fa}{AAX\_CArrayDataBuffer}}(\mbox{\hyperlink{a01793}{AAX\_CArrayDataBuffer}}\ \&\&)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00089\ \ \ \ \ \mbox{\hyperlink{a01793_a9f2a60c86fcb3a5446ceb80df82501b1}{\string~AAX\_CArrayDataBuffer}}\ (\textcolor{keywordtype}{void})\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00090\ \ \ \ \ }
\DoxyCodeLine{00091\ \ \ \ \ \mbox{\hyperlink{a01793}{AAX\_CArrayDataBuffer}}\&\ \mbox{\hyperlink{a01793_a584a2dc736485a9577d566d6af1925bc}{operator=\ }}(\mbox{\hyperlink{a01793}{AAX\_CArrayDataBuffer}}\ \textcolor{keyword}{const}\ \&\ other)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00092\ \ \ \ \ \mbox{\hyperlink{a01793}{AAX\_CArrayDataBuffer}}\&\ \mbox{\hyperlink{a01793_a584a2dc736485a9577d566d6af1925bc}{operator=\ }}(\mbox{\hyperlink{a01793}{AAX\_CArrayDataBuffer}}\ \&\&\ other)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00093\ }
\DoxyCodeLine{00094\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01793_abaa85ee4fbea2e44dc562cef003c4666}{Type}}(\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ *\ oType)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00095\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oType)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00096\ \ \ \ \ \ \ \ \ *oType\ =\ mType;}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00098\ \ \ \ \ \}}
\DoxyCodeLine{00099\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01793_a10386af32d5ba46dccb0993bd1f931ff}{Size}}(int32\_t\ *\ oSize)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oSize)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \textcolor{keyword}{const}\ size\ =\ mData.size()\ *\ \textcolor{keyword}{sizeof}(D);}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_assert}(std::numeric\_limits<\textcolor{keyword}{decltype}(size)>::max()\ >=\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max(),}
\DoxyCodeLine{00103\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}size\ variable\ may\ not\ represent\ all\ positive\ values\ of\ oSize"{}});}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (size\ >\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max())\ \{}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937a5b3c0524765174acbb042f67edc0804a}{AAX\_ERROR\_SIGNED\_INT\_OVERFLOW}};}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ *oSize\ =\ \textcolor{keyword}{static\_cast<}std::remove\_pointer<decltype(oSize)\textcolor{keyword}{>}::type>(size);}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00109\ \ \ \ \ \}}
\DoxyCodeLine{00110\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01793_a3bcc681811e8546122ac8d2b270237b8}{Data}}(\textcolor{keywordtype}{void}\ \textcolor{keyword}{const}\ **\ oBuffer)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00111\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oBuffer)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00112\ \ \ \ \ \ \ \ \ *oBuffer\ =\ mData.data();}
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00114\ \ \ \ \ \}}
\DoxyCodeLine{00115\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00116\ \ \ \ \ \mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ \textcolor{keyword}{const}\ mType;}
\DoxyCodeLine{00117\ \ \ \ \ std::vector<D>\ \textcolor{keyword}{const}\ mData;}
\DoxyCodeLine{00118\ \};}
\DoxyCodeLine{00119\ }
\DoxyCodeLine{00120\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
