Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_syncbuf<CharT,Traits,Allocator>::emit

      From cppreference.com
      <cpp‎ |io‎ |basic syncbuf
       
       
       
       
      bool emit();

      Atomically transmits all pending output to the wrapped stream.

      Allemit() calls transferring characters to the same wrapped stream buffer object appear to execute in a total order, where eachemit() callsynchronizes-with subsequentemit() calls in that total order, even if these calls are made through difference instances ofstd::basic_syncbuf/std::basic_osyncstream. In practice, this means that emit() takes a lock uniquely associated with the wrapped stream object: for example, it could be held in a static hash map where the address of the wrapped stream is used as the key.

      If a call had been made tosync since the last call toemit(), then also flushes the wrapped stream by callingpubsync() on it.

      Contents

      [edit]Parameters

      (none)

      [edit]Return value

      true if all of the following is true:

      • there is a wrapped stream (the wrapped streambuf pointer is not null)
      • all characters from the temporary storage were successfully sent into the wrapped stream
      • the call topubsync(), if requested, also completed successfully.

      Returnsfalse otherwise.

      [edit]Notes

      Normally called by the destructor or move assignment of the owningstd::basic_osyncstream, or bystd::basic_osyncstream::emit.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      destroys thebasic_osyncstream and emits its internal buffer
      (public member function ofstd::basic_osyncstream<CharT,Traits,Allocator>)[edit]
      callsemit() on the underlyingbasic_syncbuf to transmit its internal data to the final destination
      (public member function ofstd::basic_osyncstream<CharT,Traits,Allocator>)[edit]
      constructs abasic_syncbuf object
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_syncbuf/emit&oldid=157267"

      [8]ページ先頭

      ©2009-2025 Movatter.jp