Ejemplo n.º 1
0
/*! \brief Assignment operator, copies contents from \a data
	\param data The object to copy from
*/
void PacketFixedData::operator = (const PacketFixedData& data)
{
	if (this == &data)
		return;

	PACKETLOG("%s copy from %p to %p\n", __FUNCTION__, &data, this);

	delete[] m_formatList;
	delete[] m_idList;
	delete[] m_infoList;
	m_formatList = NULL;
	m_idList = NULL;
	m_infoList = NULL;

	m_itemCount = data.m_itemCount;
	m_formatList = new XsDataFormat[data.m_itemCount];
	m_idList = new XsDeviceId[data.m_itemCount];
	m_infoList = new PacketInfo[data.m_itemCount];

	for (uint16_t i = 0; i < data.m_itemCount; ++i)
	{
		m_formatList[i] = data.m_formatList[i];
		m_infoList[i] = data.m_infoList[i];
		m_idList[i] = data.m_idList[i];
	}
	m_xm = data.m_xm;

	PACKETLOG("%s exit\n", __FUNCTION__);
}
Ejemplo n.º 2
0
/*! \brief Destructor
*/
PacketFixedData::~PacketFixedData()
{
	PACKETLOG("%s %p\n", __FUNCTION__, this);
	m_itemCount = 0;
	delete[] m_formatList;
	delete[] m_infoList;
	delete[] m_idList;
	PACKETLOG("%s %p exit\n", __FUNCTION__, this);
}
Ejemplo n.º 3
0
/*! \brief Copy constructor
	\param p The object to copy the contents from
*/
PacketFixedData::PacketFixedData(const PacketFixedData& p)
	: m_infoList(NULL)
	, m_formatList(NULL)
	, m_idList(NULL)
	, m_xm(false)
	, m_itemCount(0)
{
	PACKETLOG("%s creating %p from %p\n", __FUNCTION__, this, &p);
	*this = p;
	PACKETLOG("%s done creating %p\n", __FUNCTION__, this);
}
Ejemplo n.º 4
0
Packet::Packet(const Packet& pack)
{
	PACKETLOG("Create new packet from Packet %p\n",&pack);

	m_itemCount = 0;
	m_formatList = NULL;
	m_infoList = NULL;
	*this = pack;
}
Ejemplo n.º 5
0
/*! \brief Default constructor, creates an empty (invalid) object
*/
PacketFixedData::PacketFixedData()
	: m_infoList(NULL)
	, m_formatList(NULL)
	, m_idList(NULL)
	, m_xm(false)
	, m_itemCount(0)
{
	PACKETLOG("%s creating default %p\n", __FUNCTION__, this);
}
Ejemplo n.º 6
0
Packet::Packet(uint16_t items, bool xbus)
{
	PACKETLOG("Create Packet %p\n",this);

	m_itemCount = items;
	m_infoList = NULL;
	m_formatList = new CmtDataFormat[m_itemCount];
	m_toa = 0;
	m_rtc = 0;
	m_xm = xbus;
}
Ejemplo n.º 7
0
/*! \brief Sized constructor, creates an object with room for \a count device's worth of data
	\details The constructor sets the xbus flag to false
	\param count The number of devices whose metadata is stored in the object
*/
PacketFixedData::PacketFixedData(uint16_t count)
	: m_infoList(NULL)
	, m_formatList(NULL)
	, m_idList(NULL)
	, m_xm(false)
	, m_itemCount(count)
{
	PACKETLOG("%s creating %p with %d items\n", __FUNCTION__, this, count);
	m_formatList = new XsDataFormat[m_itemCount];
	m_infoList = new PacketInfo[m_itemCount];
	m_idList = new XsDeviceId[m_itemCount];
}
Ejemplo n.º 8
0
void Packet::operator = (const Packet& pack)
{
	PACKETLOG("Copy packet from Packet %p\n",this);

	if (m_itemCount != pack.m_itemCount)
	{
		LSTCHKDELNUL(m_formatList);
		m_itemCount = pack.m_itemCount;
		m_formatList = new CmtDataFormat[m_itemCount];
	}
	for (uint16_t i = 0; i < m_itemCount; ++i)
		m_formatList[i] = pack.m_formatList[i];
	LSTCHKDELNUL(m_infoList);
	m_toa = pack.m_toa;
	m_rtc = pack.m_rtc;
	m_msg = pack.m_msg;
	m_xm = pack.m_xm;
}
Ejemplo n.º 9
0
Packet::~Packet()
{
	PACKETLOG("Destroy Packet %p\n",this);
	LSTCHKDELNUL(m_formatList);
	LSTCHKDELNUL(m_infoList);
}