Revision 1110 trunk/src/df1b2-separable/df1b2f14.cpp

df1b2f14.cpp (revision 1110)
14 14
 * Description not yet available.
15 15
 * \param
16 16
 */
17
fixed_smartlist2::fixed_smartlist2(void) 
17
fixed_smartlist2::fixed_smartlist2(void)
18 18
{
19 19
  nentries=0;
20 20
  end_saved=0;
......
34 34
 * Description not yet available.
35 35
 * \param
36 36
 */
37
fixed_smartlist2::fixed_smartlist2(unsigned int _bufsize,const adstring& _filename) 
37
fixed_smartlist2::fixed_smartlist2(unsigned int _bufsize,const adstring& _filename)
38 38
{
39 39
  allocate(_bufsize,_filename);
40 40
}
......
44 44
 * \param
45 45
 */
46 46
void fixed_smartlist2::allocate(unsigned int _bufsize,
47
  const adstring& _filename) 
47
  const adstring& _filename)
48 48
{
49 49
  nentries=_bufsize/sizeof(int);
50 50
  end_saved=0;
......
54 54
  direction=0;
55 55
  bufsize=_bufsize;
56 56
  filename=_filename;
57
  AD_ALLOCATE(true_buffer,int,nentries+2,df1b2_gradlist) 
57
  AD_ALLOCATE(true_buffer,int,nentries+2,df1b2_gradlist)
58 58
  doubleptr=(double*)true_buffer;
59 59
  true_buffend=true_buffer+nentries+1;
60 60
  buffer=true_buffer+1;
......
66 66
                   O_BINARY, S_IREAD | S_IWRITE);
67 67
  if (fp == -1)
68 68
  {
69
    cerr << "Error trying to open file " << filename 
69
    cerr << "Error trying to open file " << filename
70 70
         << " in class fixed_smartlist2 " << endl;
71 71
    ad_exit(1);
72 72
  }
......
105 105
    if (nbytes>bufsize)
106 106
    {
107 107
      cerr << "Error -- record size in file seems to be larger than"
108
       " the buffer it was created from " << endl 
108
       " the buffer it was created from " << endl
109 109
        << " buffer size is " << bufsize << " record size is supposedly "
110 110
        << nbytes << endl;
111 111
      ad_exit(1);
......
122 122
/**
123 123
 * Description not yet available.
124 124
 * \param
125
 */   
125
 */
126 126
void fixed_smartlist2::initialize(void)
127 127
{
128 128
  end_saved=0;
......
161 161
/**
162 162
 * Description not yet available.
163 163
 * \param
164
 */   
164
 */
165 165
void fixed_smartlist2::restore_end(void)
166 166
{
167 167
  if (written_flag)
......
203 203
    written_flag=1;
204 204
    // get the current file position
205 205
    off_t pos=lseek(fp,0L,SEEK_CUR);
206
  
206

  
207 207
    // write the size of the next record into the file
208 208
    ::write(fp,&nbytes,sizeof(int));
209
  
209

  
210 210
    // write the record into the file
211 211
    int nw=::write(fp,buffer,nbytes);
212
    //cout << "Number of bytes written " << nw 
213
     //    << " bptr value =  " << bptr << endl; 
212
    //cout << "Number of bytes written " << nw
213
     //    << " bptr value =  " << bptr << endl;
214 214
    //for (int ii=0;ii<=25;ii++)
215 215
    //  cout << int (*(buffer+ii)) << " ";
216 216
    //cout << endl;
......
221 221
    }
222 222
    // reset the pointer to the beginning of the buffer
223 223
    bptr=buffer;
224
  
224

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff