MCPcopy Create free account
hub / github.com/apache/trafficserver / ats_scoped_fd

Class ats_scoped_fd

include/tscore/ink_memory.h:408–440  ·  view source on GitHub ↗

namespace detail File descriptor as a scoped resource. */

Source from the content-addressed store, hash-verified

406/** File descriptor as a scoped resource.
407 */
408class ats_scoped_fd : public ats_scoped_resource<detail::SCOPED_FD_TRAITS>
409{
410public:
411 using super_type = ats_scoped_resource<detail::SCOPED_FD_TRAITS>; ///< Super type.
412 using self_type = ats_scoped_fd; ///< Self reference type.
413
414 /// Default constructor - an empty container.
415 ats_scoped_fd() : super_type() {}
416 /// Construct with contained resource.
417 explicit ats_scoped_fd(value_type rt) : super_type(rt) {}
418 /// Move ownership constructor.
419 ats_scoped_fd(self_type &&that) : super_type(that.release()) {}
420 /** Place a new resource @a rt in the container.
421 Any resource currently contained is destroyed.
422 This object becomes the owner of @a rt.
423 */
424 self_type &
425 operator=(value_type rt)
426 {
427 super_type::operator=(rt);
428 return *this;
429 }
430 /** Move the resource from @a that to @a this.
431 If @a this has a resource, that resource is destroyed.
432 This object becomes the owner of the resource in @a that.
433 */
434 self_type &
435 operator=(self_type &&that)
436 {
437 super_type::operator=(that.release());
438 return *this;
439 }
440};
441
442namespace detail
443{

Callers 2

loadDeviceMethod · 0.85

Calls 1

releaseMethod · 0.45

Tested by

no test coverage detected