memorybuf::in_dynamic Class Reference

An output streambuf for memory access. More...

Inheritance diagram for memorybuf::in_dynamic:
Collaboration diagram for memorybuf::in_dynamic:

Public Member Functions

 in_dynamic ()=default
 Default construct - empty. More...
 
 in_dynamic (const char *s, std::streamsize n)
 Copy construct from content. More...
 
 in_dynamic (::Foam::List< char > &&buffer)
 Move construct from List. More...
 
template<int SizeMin>
 in_dynamic (::Foam::DynamicList< char, SizeMin > &&buffer)
 Move construct from DynamicList (added length only) More...
 
void sync_gbuffer ()
 Sync get buffer pointers to agree with list dimensions. More...
 
void reset (const char *s, std::streamsize n)
 Reset content (copy) More...
 
void swap (List< char > &other)
 Exchange buffer content and parameter contents, reset positions. More...
 
template<int SizeMin>
void swap (DynamicList< char, SizeMin > &other)
 Exchange buffer content and parameter contents, reset positions. More...
 
DynamicList< char > release ()
 Reset buffer and return contents. More...
 
- Public Member Functions inherited from memorybuf::in_base
 in_base ()=default
 Default construct. More...
 
 in_base (char *s, std::streamsize n)
 Construct for character array (can be nullptr) and number of bytes. More...
 
void resetg (char *s, std::streamsize n)
 Reset get buffer with character data (can be nullptr) and count. More...
 
std::streamsize span_tellg () const
 The current buffer get position. More...
 
std::streamsize span_capacity () const
 The get buffer capacity. More...
 
std::streamsize span_remaining () const
 The number of characters remaining in the get area. More...
 
char * data_bytes () const
 The span data (start of input characters) More...
 
std::streamsize size_bytes () const
 The span size (number of input characters) More...
 
stdFoam::span< const char > view () const
 
void info (Ostream &os) const
 Some information about the input buffer position/capacity. More...
 

Additional Inherited Members

- Protected Member Functions inherited from memorybuf::in_base
virtual std::streamsize xsgetn (char *s, std::streamsize n)
 Get sequence of characters from a fixed region. More...
 
- Protected Member Functions inherited from memorybuf
virtual std::streampos seekoff (std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 Set position pointer to relative position. More...
 
virtual std::streampos seekpos (std::streampos pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 Set position pointer to absolute position. More...
 

Detailed Description

An output streambuf for memory access.

Definition at line 265 of file memoryStreamBuffer.H.

Constructor & Destructor Documentation

◆ in_dynamic() [1/4]

in_dynamic ( )
default

Default construct - empty.

◆ in_dynamic() [2/4]

in_dynamic ( const char *  s,
std::streamsize  n 
)
inline

Copy construct from content.

Definition at line 289 of file memoryStreamBuffer.H.

References UList< T >::data(), n, List< T >::resize_nocopy(), s, and memorybuf::in_dynamic::sync_gbuffer().

Here is the call graph for this function:

◆ in_dynamic() [3/4]

in_dynamic ( ::Foam::List< char > &&  buffer)
inline

Move construct from List.

Definition at line 302 of file memoryStreamBuffer.H.

References memorybuf::in_dynamic::sync_gbuffer().

Here is the call graph for this function:

◆ in_dynamic() [4/4]

in_dynamic ( ::Foam::DynamicList< char, SizeMin > &&  buffer)
inline

Move construct from DynamicList (added length only)

Definition at line 313 of file memoryStreamBuffer.H.

References memorybuf::in_dynamic::sync_gbuffer(), and List< T >::transfer().

Here is the call graph for this function:

Member Function Documentation

◆ sync_gbuffer()

void sync_gbuffer ( )
inline

Sync get buffer pointers to agree with list dimensions.

Sets get pointer to the begin (rewind).

Definition at line 327 of file memoryStreamBuffer.H.

References UList< T >::data(), memorybuf::in_base::resetg(), and UList< T >::size().

Referenced by memorybuf::in_dynamic::in_dynamic(), memorybuf::in_dynamic::release(), memorybuf::in_dynamic::reset(), and memorybuf::in_dynamic::swap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void reset ( const char *  s,
std::streamsize  n 
)
inline

Reset content (copy)

Definition at line 335 of file memoryStreamBuffer.H.

References List< T >::clear(), UList< T >::data(), n, List< T >::resize_nocopy(), s, and memorybuf::in_dynamic::sync_gbuffer().

Referenced by icharstream::reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap() [1/2]

void swap ( List< char > &  other)
inline

Exchange buffer content and parameter contents, reset positions.

Definition at line 352 of file memoryStreamBuffer.H.

References UList< T >::swap(), and memorybuf::in_dynamic::sync_gbuffer().

Referenced by icharstream::swap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swap() [2/2]

void swap ( DynamicList< char, SizeMin > &  other)
inline

Exchange buffer content and parameter contents, reset positions.

Definition at line 362 of file memoryStreamBuffer.H.

References DynamicList< T, SizeMin >::swap(), and memorybuf::in_dynamic::sync_gbuffer().

Here is the call graph for this function:

◆ release()

DynamicList<char> release ( )
inline

Reset buffer and return contents.

Definition at line 372 of file memoryStreamBuffer.H.

References memorybuf::in_dynamic::sync_gbuffer().

Referenced by icharstream::release().

Here is the call graph for this function:
Here is the caller graph for this function:

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