Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_header.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   OpenIGTLink Library
00004   Module:    $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlutil/igtl_header.h $
00005   Language:  C
00006   Date:      $Date: 2011-03-24 00:32:25 -0400 (Thu, 24 Mar 2011) $
00007   Version:   $Revision: 7357 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010 
00011   This software is distributed WITHOUT ANY WARRANTY; without even
00012   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013   PURPOSE.  See the above copyright notices for more information.
00014 
00015 =========================================================================*/
00016 
00017 #ifndef __IGTL_HEADER_H
00018 #define __IGTL_HEADER_H
00019 
00020 #define IGTL_HEADER_VERSION   1
00021 #define IGTL_HEADER_SIZE      58
00022 
00023 #define IGTL_HEADER_TYPE_SIZE  12
00024 #define IGTL_HEADER_NAME_SIZE  20
00025 
00026 /* Following macros will be obsolete. Included for old programs*/
00027 #define IGTL_HEADER_TYPESIZE  IGTL_HEADER_TYPE_SIZE
00028 #define IGTL_HEADER_NAMESIZE  IGTL_HEADER_NAME_SIZE
00029 #define IGTL_HEADER_DEVSIZE   IGTL_HEADER_NAME_SIZE
00030 
00031 // Device name prefix macro
00032 #define IGTL_TYPE_PREFIX_NONE     0
00033 #define IGTL_TYPE_PREFIX_GET      1
00034 #define IGTL_TYPE_PREFIX_STT      2
00035 #define IGTL_TYPE_PREFIX_STP      3
00036 #define IGTL_TYPE_PREFIX_RTS      4
00037 #define IGTL_NUM_TYPE_PREFIX      5
00038 
00039 
00040 #include "igtl_types.h"
00041 #include "igtl_win32header.h"
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00047 #pragma pack(1)     /* For 1-byte boundary in memroy */
00048 
00049 /*
00050  * Message header of OpenIGTLink message.
00051  *
00052  * igtl_header is an overall data header for OpenIGTLink protocol.
00053  * It is transfered at beginning of every OpenIGTLink message to give
00054  * type and size of following data body to a receiver.
00055  * These parameters allow the receiver to parse or skip the data body.
00056  */
00057 
00058 typedef struct {
00059   igtl_uint16    version;          /* protocol version number */
00060   char           name[IGTL_HEADER_TYPE_SIZE];       /* data type name          */
00061   char           device_name[IGTL_HEADER_NAME_SIZE]; /* device name             */
00062   igtl_uint64    timestamp;        /* time stamp message      */
00063   igtl_uint64    body_size;        /* size of the body        */
00064   igtl_uint64    crc;              /* CRC                     */
00065 } igtl_header;
00066 
00067 #pragma pack()
00068 
00069 /*
00070  * Byte order converter for the header structre
00071  * 
00072  * igtl_header_convert_byte_order convers endianness of each
00073  * member variable in igtl_header structre from host byte order
00074  * to network byte order, or vice versa.
00075  *
00076  */
00077 void igtl_export igtl_header_convert_byte_order(igtl_header * header);
00078 
00079 #ifdef __cplusplus
00080 }
00081 #endif
00082 
00083 #endif /* __IGTL_HEADER_H */
00084 
00085 

Generated at Wed Apr 27 2011 00:08:07 for OpenIGTLink by doxygen 1.7.4 written by Dimitri van Heesch, © 1997-2000