AMFImporter: fix coverity findings.
authorKim Kulling <kim.kulling@goolemail.com>
Wed, 10 May 2017 16:29:42 +0000 (18:29 +0200)
committerKim Kulling <kim.kulling@goolemail.com>
Wed, 10 May 2017 16:29:42 +0000 (18:29 +0200)
code/AMFImporter_Node.hpp

index 1a9e701..e37d7af 100644 (file)
@@ -60,18 +60,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 /// \class CAMFImporter_NodeElement
 /// Base class for elements of nodes.
-class CAMFImporter_NodeElement
-{
-       /***********************************************/
-       /******************** Types ********************/
-       /***********************************************/
+class CAMFImporter_NodeElement {
 
 public:
-
-       /// \enum EType
        /// Define what data type contain node element.
-       enum EType
-       {
+       enum EType {
                ENET_Color,        ///< Color element: <color>.
                ENET_Constellation,///< Grouping element: <constellation>.
                ENET_Coordinates,  ///< Coordinates element: <coordinates>.
@@ -92,52 +85,37 @@ public:
                ENET_Invalid       ///< Element has invalid type and possible contain invalid data.
        };
 
-       /***********************************************/
-       /****************** Constants ******************/
-       /***********************************************/
-
-public:
-
        const EType Type;///< Type of element.
-
-       /***********************************************/
-       /****************** Variables ******************/
-       /***********************************************/
-
-public:
-
        std::string ID;///< ID of element.
-       CAMFImporter_NodeElement* Parent;///< Parrent element. If nullptr then this node is root.
+       CAMFImporter_NodeElement* Parent;///< Parent element. If nullptr then this node is root.
        std::list<CAMFImporter_NodeElement*> Child;///< Child elements.
 
-       /***********************************************/
-       /****************** Functions ******************/
-       /***********************************************/
+public:                                               /// Destructor, virtual..
+    virtual ~CAMFImporter_NodeElement() {
+        // empty
+    }
 
 private:
-
-       /// \fn CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement)
        /// Disabled copy constructor.
        CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement);
 
-       /// \fn CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement)
        /// Disabled assign operator.
        CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement);
 
-       /// \fn CAMFImporter_NodeElement()
        /// Disabled default constructor.
        CAMFImporter_NodeElement();
 
 protected:
-
-       /// \fn CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
        /// In constructor inheritor must set element type.
        /// \param [in] pType - element type.
        /// \param [in] pParent - parent element.
        CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
-               : Type(pType), Parent(pParent)
-       {}
-
+       : Type(pType)
+    , ID()
+    , Parent(pParent)
+    , Child() {
+        // empty
+    }
 };// class IAMFImporter_NodeElement
 
 /// \struct CAMFImporter_NodeElement_Constellation