varsizemsg.h File Reference

Go to the source code of this file.

Defines

#define VARSIZE_DECL(MSGTYPE)
#define VARSIZE_MSG(MSGTYPE, MSGDATA)
#define VARSIZE_ARRAY(ARRAY)

Functions

template<class T>
T * cast_array (T *, char *a)
template<class T>
T * cast_size (T *, size_t a)


Define Documentation

#define VARSIZE_ARRAY ( ARRAY   ) 

Value:

{ \
  int varsizemsg_arraysize; \
  switch ( varsizemsg_pass ) { \
  case 0: \
    varsizemsg_arraysize = sizeof(*(varsizemsg_msg->ARRAY)) * \
                varsizemsg_array[varsizemsg_arraycount]; \
    varsizemsg_totalsize += ALIGN8(varsizemsg_arraysize); \
    varsizemsg_arraycount++; \
    break; \
  case 1: \
    varsizemsg_msg->ARRAY = cast_array(varsizemsg_msg->ARRAY, \
        (char *) varsizemsg_msg + varsizemsg_totalsize); \
    varsizemsg_arraysize = sizeof(*(varsizemsg_msg->ARRAY)) * \
                varsizemsg_array[varsizemsg_arraycount]; \
    varsizemsg_totalsize += ALIGN8(varsizemsg_arraysize); \
    varsizemsg_arraycount++; \
    break; \
  case 2: \
    varsizemsg_msg->ARRAY = cast_size(varsizemsg_msg->ARRAY, \
      (char *) (varsizemsg_msg->ARRAY) - (char *) &(varsizemsg_msg->ARRAY) ); \
    break; \
  case 3: \
    varsizemsg_msg->ARRAY = cast_array(varsizemsg_msg->ARRAY, \
      (char *) &(varsizemsg_msg->ARRAY) + (size_t) (varsizemsg_msg->ARRAY) ); \
    break; \
  default: \
    break; \
  } \
}

Definition at line 81 of file varsizemsg.h.

#define VARSIZE_DECL ( MSGTYPE   ) 

Value:

static void *alloc(int, int, int *, int); \
  static void *pack(MSGTYPE *); \
  static MSGTYPE* unpack(void *)
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 32 of file varsizemsg.h.

#define VARSIZE_MSG ( MSGTYPE,
MSGDATA   ) 

Definition at line 37 of file varsizemsg.h.


Function Documentation

template<class T>
T* cast_array ( T *  ,
char *  a 
) [inline]

Definition at line 78 of file varsizemsg.h.

00078 { return (T*) a; }

template<class T>
T* cast_size ( T *  ,
size_t  a 
) [inline]

Definition at line 79 of file varsizemsg.h.

00079 { return (T*) a; }


Generated on Tue Sep 26 01:17:16 2017 for NAMD by  doxygen 1.4.7