LCOV - code coverage report
Current view: top level - src/moab - UnknownInterface.hpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 16 18 88.9 %
Date: 2020-12-16 07:07:30 Functions: 3 4 75.0 %
Branches: 1 2 50.0 %

           Branch data     Line data    Source code
       1                 :            : /*  Filename   :     UnkonwnInterface.h
       2                 :            :  *  Creator    :     Clinton Stimpson
       3                 :            :  *
       4                 :            :  *  Date       :     10 Jan 2002
       5                 :            :  *
       6                 :            :  *  Owner      :     Clinton Stimpson
       7                 :            :  *
       8                 :            :  *  Description:     Contains declarations for MBuuid which keeps
       9                 :            :  *                   track of different interfaces.
      10                 :            :  *                   Also contains the declaration for the base class
      11                 :            :  *                   UknownInterface from which all interfaces are
      12                 :            :  *                   derived from
      13                 :            :  */
      14                 :            : 
      15                 :            : #ifndef MOAB_UNKNOWN_INTERFACE_HPP
      16                 :            : #define MOAB_UNKNOWN_INTERFACE_HPP
      17                 :            : 
      18                 :            : #include <memory.h>
      19                 :            : 
      20                 :            : namespace moab
      21                 :            : {
      22                 :            : 
      23                 :            : //!  struct that handles universally unique id's for the Mesh Database
      24                 :            : 
      25                 :            : // note: this MBuuid is compliant with the windows GUID.
      26                 :            : // It is possible to do a memcpy() to copy the data from a MBuuid to a GUID
      27                 :            : // if we want to support dll registration
      28                 :            : struct MBuuid
      29                 :            : {
      30                 :            :     //! default constructor that initializes to zero
      31                 :            :     MBuuid()
      32                 :            :     {
      33                 :            :         memset( this, 0, sizeof( MBuuid ) );
      34                 :            :     }
      35                 :            :     //! constructor that takes initialization arguments
      36                 :       9608 :     MBuuid( unsigned l, unsigned short w1, unsigned short w2, unsigned char b1, unsigned char b2, unsigned char b3,
      37                 :            :             unsigned char b4, unsigned char b5, unsigned char b6, unsigned char b7, unsigned char b8 )
      38                 :            :     {
      39                 :       9608 :         data1    = l;
      40                 :       9608 :         data2    = w1;
      41                 :       9608 :         data3    = w2;
      42                 :       9608 :         data4[0] = b1;
      43                 :       9608 :         data4[1] = b2;
      44                 :       9608 :         data4[2] = b3;
      45                 :       9608 :         data4[3] = b4;
      46                 :       9608 :         data4[4] = b5;
      47                 :       9608 :         data4[5] = b6;
      48                 :       9608 :         data4[6] = b7;
      49                 :       9608 :         data4[7] = b8;
      50                 :       9608 :     }
      51                 :            :     //! copy constructor
      52                 :            :     MBuuid( const MBuuid& mdbuuid )
      53                 :            :     {
      54                 :            :         memcpy( this, &mdbuuid, sizeof( MBuuid ) );
      55                 :            :     }
      56                 :            :     //! sets this uuid equal to another one
      57                 :            :     MBuuid& operator=( const MBuuid& orig )
      58                 :            :     {
      59                 :            :         memcpy( this, &orig, sizeof( MBuuid ) );
      60                 :            :         return *this;
      61                 :            :     }
      62                 :            :     //! returns whether two uuid's are equal
      63                 :          0 :     bool operator==( const MBuuid& orig ) const
      64                 :            :     {
      65                 :          0 :         return !memcmp( this, &orig, sizeof( MBuuid ) );
      66                 :            :     }
      67                 :            :     //! returns whether two uuid's are not equal
      68                 :            :     bool operator!=( const MBuuid& orig ) const
      69                 :            :     {
      70                 :            :         return !( *this == orig );
      71                 :            :     }
      72                 :            : 
      73                 :            :     //! uuid data storage
      74                 :            :     unsigned data1;
      75                 :            :     unsigned short data2;
      76                 :            :     unsigned short data3;
      77                 :            :     unsigned char data4[8];
      78                 :            : };
      79                 :            : 
      80                 :            : //! uuid for an unknown interface
      81                 :            : //! this can be used to either return a default interface
      82                 :            : //! or a NULL interface
      83                 :       4804 : static const MBuuid IDD_MBUnknown =
      84                 :            :     MBuuid( 0xf4f6605e, 0x2a7e, 0x4760, 0xbb, 0x06, 0xb9, 0xed, 0x27, 0xe9, 0x4a, 0xec );
      85                 :            : 
      86                 :            : //! base class for all interface classes
      87                 :        372 : class UnknownInterface
      88                 :            : {
      89                 :            :   public:
      90                 :            :     virtual int QueryInterface( const MBuuid&, UnknownInterface** ) = 0;
      91         [ -  + ]:        738 :     virtual ~UnknownInterface() {}
      92                 :            : };
      93                 :            : 
      94                 :            : }  // namespace moab
      95                 :            : 
      96                 :            : #endif  // MOAB_UNKNOWN_INTERFACE_HPP

Generated by: LCOV version 1.11