Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ajaanc/includes/ancillarylist.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ class AJAExport AJAAncillaryList
///@{
AJAAncillaryList (); ///< @brief Instantiate and initialize with a default set of values.
inline AJAAncillaryList (const AJAAncillaryList & inRHS) {*this = inRHS;} ///< @brief My copy constructor.
#if defined(AJA_USE_CPLUSPLUS11)
AJAAncillaryList (AJAAncillaryList && inRHS); ///< @brief Move-construct constructor.
#endif
virtual ~AJAAncillaryList (); ///< @brief My destructor.

/**
Expand All @@ -186,6 +189,15 @@ class AJAExport AJAAncillaryList
virtual AJAAncillaryList & operator = (const AJAAncillaryList & inRHS);
///@}

#if defined(AJA_USE_CPLUSPLUS11)
/**
@brief Move-assignment operator -- moves contents from the right-hand-side to my contents, replacing my contents, and resets the right-hand-side.
@param[in] inRHS The list of packets to be move into me.
@return An r-value reference to myself.
**/
virtual AJAAncillaryList & operator = (AJAAncillaryList && inRHS);
#endif


/**
@name Fetching, Searching & Enumerating Packets
Expand Down
38 changes: 38 additions & 0 deletions ajaanc/src/ancillarylist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#if defined(AJAANCLISTIMPL_VECTOR)
#include <algorithm>
#endif
#if defined(AJA_USE_CPLUSPLUS11)
#include <utility> // For std::move
#endif

using namespace std;

Expand Down Expand Up @@ -163,6 +166,21 @@ AJAAncillaryList::AJAAncillaryList ()
SetAnalogAncillaryDataTypeForLine (285, AJAAncDataType_Cea608_Line21);
}

#if defined(AJA_USE_CPLUSPLUS11)
AJAAncillaryList::AJAAncillaryList(AJAAncillaryList && inRHS)
: m_ancList(std::move(inRHS.m_ancList)),
m_rcvMultiRTP(inRHS.m_rcvMultiRTP),
m_xmitMultiRTP(inRHS.m_xmitMultiRTP),
m_ignoreCS(inRHS.m_ignoreCS)
{
// Reset RHS.
inRHS.m_rcvMultiRTP = true;
inRHS.m_xmitMultiRTP = false;
inRHS.m_ignoreCS = false;
// inRHS.m_ancList - already moved/reset.
}
#endif


AJAAncillaryList::~AJAAncillaryList ()
{
Expand All @@ -185,6 +203,26 @@ AJAAncillaryList & AJAAncillaryList::operator = (const AJAAncillaryList & inRHS)
return *this;
}

#if defined(AJA_USE_CPLUSPLUS11)
AJAAncillaryList & AJAAncillaryList::operator = (AJAAncillaryList && inRHS)
{
if (this != &inRHS)
{
m_xmitMultiRTP = inRHS.m_xmitMultiRTP;
inRHS.m_xmitMultiRTP = false;

m_rcvMultiRTP = inRHS.m_rcvMultiRTP;
inRHS.m_rcvMultiRTP = true;

m_ignoreCS = inRHS.m_ignoreCS;
inRHS.m_ignoreCS = false;

Clear(); // Clear down any packets currently being held in 'this'
m_ancList = std::move(inRHS.m_ancList);
}
return *this;
}
#endif

AJAAncillaryData * AJAAncillaryList::GetAncillaryDataAtIndex (const uint32_t inIndex) const
{
Expand Down