Jpp  18.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
JLANG::JFileOutputStream Class Reference

Streaming of output. More...

#include <JFileStream.hh>

Inheritance diagram for JLANG::JFileOutputStream:
JLANG::JFileOutputStreamBuffer std::vector< char >

Public Member Functions

 JFileOutputStream (const JAbstractFile &file, const std::size_t size=65536)
 Constructor. More...
 

Protected Types

typedef traits_type::int_type int_type
 
typedef std::streamsize streamsize
 

Protected Member Functions

virtual int_type overflow (int_type c) override
 Check overflow. More...
 
virtual int sync () override
 Synchronise buffer. More...
 
bool out_avail (JTimeval timeout=JTimeval::min()) const
 Check availability of output. More...
 
int flush ()
 Flush internal buffer. More...
 

Protected Attributes

JFile out
 

Detailed Description

Streaming of output.

Definition at line 46 of file JFileStream.hh.

Member Typedef Documentation

typedef traits_type::int_type JLANG::JFileOutputStreamBuffer::int_type
inherited

Definition at line 121 of file JFileStreamBuffer.hh.

typedef std::streamsize JLANG::JFileOutputStreamBuffer::streamsize
inherited

Definition at line 122 of file JFileStreamBuffer.hh.

Constructor & Destructor Documentation

JLANG::JFileOutputStream::JFileOutputStream ( const JAbstractFile file,
const std::size_t  size = 65536 
)
inline

Constructor.

Parameters
filefile
sizesize of internal buffer

Definition at line 57 of file JFileStream.hh.

58  :
59  JFileOutputStreamBuffer(file, size),
60  std::ostream(this)
61  {}
JFileOutputStreamBuffer(const JAbstractFile &file, const std::size_t size=65536)
Constructor.

Member Function Documentation

virtual int_type JLANG::JFileOutputStreamBuffer::overflow ( int_type  c)
inlineoverridevirtualinherited

Check overflow.

This method writes one byte if possible.

Parameters
ccharacter
Returns
c if OK; else EOF

Definition at line 159 of file JFileStreamBuffer.hh.

160  {
161  if (c != traits_type::eof()) {
162 
163  *pptr() = (char) c;
164 
165  pbump(1);
166 
167  if (flush() == traits_type::eof()) {
168  return traits_type::eof();
169  }
170  }
171 
172  return c;
173  }
int flush()
Flush internal buffer.
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
virtual int JLANG::JFileOutputStreamBuffer::sync ( )
inlineoverridevirtualinherited

Synchronise buffer.

Definition at line 179 of file JFileStreamBuffer.hh.

180  {
181  if (flush() == traits_type::eof())
182  return -1;
183  else
184  return 0;
185  }
int flush()
Flush internal buffer.
bool JLANG::JFileOutputStreamBuffer::out_avail ( JTimeval  timeout = JTimeval::min()) const
inlineinherited

Check availability of output.

This method returns true if at least one byte can be written without blocking.

Parameters
timeouttimeout
Returns
true if ready to write; else false

Definition at line 195 of file JFileStreamBuffer.hh.

196  {
197  return JFileDescriptorMask(out).out_avail(timeout);
198  }
bool out_avail(JTimeval timeout=JTimeval::min())
Check availability of output.
Auxiliary class for method select.
int JLANG::JFileOutputStreamBuffer::flush ( )
inlineprotectedinherited

Flush internal buffer.

Definition at line 204 of file JFileStreamBuffer.hh.

205  {
206  const int len = pptr() - pbase();
207 
208  if (len != 0) {
209 
210  if (out.write(this->data(), len) != len) {
211  return traits_type::eof();
212  }
213 
214  pbump(-len);
215  }
216 
217  return len;
218  }
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn this
virtual int write(const char *buffer, const int length)
Write data to file.
Definition: JFile.hh:87

Member Data Documentation

JFile JLANG::JFileOutputStreamBuffer::out
protectedinherited

Definition at line 221 of file JFileStreamBuffer.hh.


The documentation for this class was generated from the following file: