Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFC_Window_base_IO_binary.C File Reference
#include "RFC_Window_base.h"
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <cassert>
Include dependency graph for RFC_Window_base_IO_binary.C:

Go to the source code of this file.

Functions

RFC_BEGIN_NAME_SPACE void write (std::ostream &os, const int t)
 
void read (std::istream &is, int &t)
 
void swap_endian (short int &t)
 
void swap_endian (int &t)
 
void swap_endian (float &t)
 
void swap_endian (double &t)
 

Function Documentation

void read ( std::istream &  is,
int &  t 
)
inline

Definition at line 40 of file RFC_Window_base_IO_binary.C.

40  {
41  is.read((char*)&t, sizeof(int));
42 }
void swap_endian ( short int &  t)
inline

Definition at line 45 of file RFC_Window_base_IO_binary.C.

References swap().

Referenced by RFC_Pane_base::read_binary().

45  {
46  char *c = (char*)&t;
47  std::swap( c[0],c[1]);
48 }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

Here is the caller graph for this function:

void swap_endian ( int &  t)
inline

Definition at line 51 of file RFC_Window_base_IO_binary.C.

References swap().

51  {
52  char *c = (char*)&t;
53  std::swap( c[0],c[3]); std::swap( c[1],c[2]);
54 }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

void swap_endian ( float &  t)
inline

Definition at line 57 of file RFC_Window_base_IO_binary.C.

References swap().

57  {
58  char *c = (char*)&t;
59  std::swap( c[0],c[3]); std::swap( c[1],c[2]);
60 }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

void swap_endian ( double &  t)
inline

Definition at line 63 of file RFC_Window_base_IO_binary.C.

References swap().

63  {
64  char *c = (char*)&t;
65  std::swap( c[0],c[7]); std::swap( c[1],c[6]);
66  std::swap( c[2],c[5]); std::swap( c[3],c[4]);
67 }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

RFC_BEGIN_NAME_SPACE void write ( std::ostream &  os,
const int  t 
)
inline

Definition at line 35 of file RFC_Window_base_IO_binary.C.

35  {
36  os.write((char*)&t, sizeof(int));
37 }