LCOV - code coverage report
Current view: top level - src - node.h (source / functions) Hit Total Coverage
Test: qucs-core-0.0.19 Code Coverage Lines: 10 16 62.5 %
Date: 2015-01-05 16:01:02 Functions: 10 13 76.9 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * node.h - node class definitions
       3                 :            :  *
       4                 :            :  * Copyright (C) 2003, 2004 Stefan Jahn <stefan@lkcc.org>
       5                 :            :  *
       6                 :            :  * This is free software; you can redistribute it and/or modify
       7                 :            :  * it under the terms of the GNU General Public License as published by
       8                 :            :  * the Free Software Foundation; either version 2, or (at your option)
       9                 :            :  * any later version.
      10                 :            :  *
      11                 :            :  * This software is distributed in the hope that it will be useful,
      12                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14                 :            :  * GNU General Public License for more details.
      15                 :            :  *
      16                 :            :  * You should have received a copy of the GNU General Public License
      17                 :            :  * along with this package; see the file COPYING.  If not, write to
      18                 :            :  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
      19                 :            :  * Boston, MA 02110-1301, USA.
      20                 :            :  *
      21                 :            :  * $Id$
      22                 :            :  *
      23                 :            :  */
      24                 :            : 
      25                 :            : #ifndef __NODE_H__
      26                 :            : #define __NODE_H__
      27                 :            : 
      28                 :            : namespace qucs {
      29                 :            : 
      30                 :            : class circuit;
      31                 :            : 
      32         [ -  + ]:     348485 : class node : public object
      33                 :            : {
      34                 :            :  public:
      35                 :            :   //! Constructor creates an unnamed instance of the node class.
      36                 :     348485 :   node () : object (), nNode(0), port(0), internal(0), _circuit(nullptr) {};
      37                 :            :   //! Constructor creates a named instance of the node class.
      38                 :            :   node (char * const n) : object (n), nNode(0), port(0), internal(0), _circuit(nullptr) {};
      39                 :            :   /* The copy constructor creates a new instance 
      40                 :            :      of the node class based on the given node object. 
      41                 :            :      \todo circuit lifetime
      42                 :            :      \todo why not use default ?
      43                 :            :    */
      44                 :          0 :   node (const node &n) : object (n) {
      45                 :          0 :     internal = n.internal;
      46                 :          0 :     port = n.port;
      47                 :          0 :     nNode = n.nNode;
      48                 :          0 :     _circuit = n._circuit;
      49                 :          0 :   }
      50                 :            :   //! Sets the unique number of this node
      51                 :          6 :   void setNode (const int n) { this->nNode = n ; };
      52                 :            :   //! Returns the unique number of this node.
      53                 :       1422 :   int  getNode (void) const { return this->nNode; };
      54                 :            :   //! Sets the port number of this node.
      55                 :     384558 :   void setPort (const int p) { this->port = p; };
      56                 :            :   //! Returns the port number of this node.
      57                 :   64416129 :   int  getPort (void) const { return this->port; };
      58                 :            :   //! Sets this node's circuit.
      59                 :     384558 :   void setCircuit (circuit *const c) { this->_circuit = c; };
      60                 :  476425646 :   circuit * getCircuit (void) const { return this->_circuit; };
      61                 :     384274 :   void setInternal (int i) { internal = i; }
      62                 :    1173981 :   int  getInternal (void) { return internal; }
      63                 :            : 
      64                 :            :  private:
      65                 :            :   int nNode;
      66                 :            :   int port;
      67                 :            :   int internal;
      68                 :            :   circuit * _circuit;
      69                 :            : };
      70                 :            : 
      71                 :            : } // namespace qucs
      72                 :            : 
      73                 :            : #endif /* __NODE_H__ */

Generated by: LCOV version 1.11