Namespaces
Variants

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

From cppreference.net
std::basic_syncbuf
Public member functions
basic_syncbuf::basic_syncbuf
(C++20)
Protected member functions
Non-member functions
basic_syncbuf ( )
: basic_syncbuf ( nullptr )
(1)
explicit basic_syncbuf ( streambuf_type * obuf )
: basic_syncbuf ( obuf, Allocator ( ) ) { }
(2)
basic_syncbuf ( streambuf_type * obuf, const Allocator & a ) ;
(3)
basic_syncbuf ( basic_syncbuf && rhs ) ;
(4)
1) 기본 생성자: 동기화 시 방출 정책이 false 로 설정되고, 래핑된 스트림 버퍼가 nullptr 로 설정되며, 임시 저장소를 위한 할당자로 기본 생성된 Allocator 를 사용하는 std::basic_syncbuf 인스턴스를 생성합니다.
2,3) std::basic_syncbuf 의 인스턴스를 생성하며, 동기화 시 방출 정책을 false 로 설정하고, 래핑된 스트림 버퍼를 obuf 로 설정하며, 임시 저장소를 위한 할당자로 a 를 사용합니다.
4) 이동 생성자: 다른 std::basic_syncbuf 객체 rhs 의 모든 내용(임시 저장소, 래핑된 스트림 포인터, 정책 및 기타 모든 상태(뮤텍스 포인터 등))을 이동하여 std::basic_syncbuf 객체를 이동 생성합니다. 이동 후, rhs 는 스트림과 연결되지 않으며, rhs. get_wrapped ( ) == nullptr 입니다. rhs 의 기본 클래스 std::basic_streambuf 의 put 영역 멤버 포인터는 null임이 보장됩니다. 이동된 rhs 를 파괴해도 어떠한 출력도 생성되지 않습니다.

목차

매개변수

obuf - 래핑할 std::basic_streambuf 에 대한 포인터
a - 임시 저장소에 사용할 할당자
rhs - 이동할 다른 std::basic_syncbuf 객체

예외

2,3) 내부 임시 저장소의 생성자로부터 std::bad_alloc 을 던지거나, 뮤텍스 생성으로부터 std::system_error 을 던질 수 있습니다.

참고 사항

일반적으로 std::basic_osyncstream 의 적절한 생성자들에 의해 호출됩니다.

예제

참고 항목

[virtual]
연관된 문자 시퀀스와 버퍼를 동기화합니다
( std::basic_streambuf<CharT,Traits> 의 virtual protected member function)
내부 버퍼 전체를 래핑된 streambuf로 원자적으로 전송합니다
(public member function)