I have a template class as follows:

template <typename T>
class PacketMember
{
public:
    PacketMember(const std::size_t maxMemberSize, const QString memberName) :
        m_maxMemberSize(maxMemberSize),
        m_memberName(memberName)
    {

    }

    void append(const T data, const std::size_t length)
    {
        if(currentMemberSize() + length <= m_maxMemberSize)
        {
            for(std::size_t i = 0 ; i < length ; ++i) {
                m_data = data;
                m_member.push_back(m_data);
            }
        }
    }

    QString memberName() const
    {
        return m_memberName;
    }

    std::size_t currentMemberSize() const
    {
        return m_member.size();
    }

    std::size_t maxMemberSize() const
    {
        return m_maxMemberSize;
    }

    std::vector<T>* member() const
    {
        return m_member;
    }

    void setMaxMemberSize(const std::size_t newSize) {
        m_maxMemberSize = newSize;
    }

private:
    T m_data;
    std::vector<T> m_member;
    std::size_t m_maxMemberSize;
    QString m_memberName;
};
… 180 more words