BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdljsn::Location Class Reference

#include <bdljsn_location.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (Location, bslmf::IsBitwiseMoveable)
 
 Location ()
 Create a Location object having the default value, 0.
 
 Location (bsl::uint64_t offset)
 Create a Location object having the specified offset.
 
 Location (const Location &original)
 
 ~Location ()=default
 
Locationoperator= (const Location &rhs)
 Assign to this object the value of the specified rhs object.
 
Locationreset ()
 
LocationsetOffset (bsl::uint64_t value)
 Set the "offset" attribute of this object to the specified value.
 
void swap (Location &other)
 
bsl::uint64_t offset () const
 Return the offset attribute of this object.
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Friends

template<class HASHALG >
void hashAppend (HASHALG &hashAlg, const Location &)
 
void swap (Location &, Location &)
 

Detailed Description

This unconstrained (value-semantic) attribute class specifies a location in a (JSON) document. See the {Attributes} section under {DESCRIPTION} in the component-level documentation for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

See bdljsn_location

Constructor & Destructor Documentation

◆ Location() [1/3]

bdljsn::Location::Location ( )
inline

◆ Location() [2/3]

bdljsn::Location::Location ( bsl::uint64_t  offset)
inlineexplicit

◆ Location() [3/3]

bdljsn::Location::Location ( const Location original)
inline

Create a Location object having the same value as the specified original object.

◆ ~Location()

bdljsn::Location::~Location ( )
default

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

bdljsn::Location::BSLMF_NESTED_TRAIT_DECLARATION ( Location  ,
bslmf::IsBitwiseMoveable   
)

◆ offset()

bsl::uint64_t bdljsn::Location::offset ( ) const
inline

◆ operator=()

Location & bdljsn::Location::operator= ( const Location rhs)
inline

◆ print()

bsl::ostream & bdljsn::Location::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the optionally specified indentation level and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. Each line is indented by the absolute value of level * spacesPerLevel. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, suppress line breaks and format the entire output on one line. If stream is initially invalid, this operation has no effect. Note that a trailing newline is provided in multiline mode only.

◆ reset()

Location & bdljsn::Location::reset ( )
inline

Reset this object to the default value (i.e., its value upon default construction).

◆ setOffset()

Location & bdljsn::Location::setOffset ( bsl::uint64_t  value)
inline

◆ swap()

void bdljsn::Location::swap ( Location other)
inline

Efficiently exchange the value of this object with the value of the specified other object. This method provides the no-throw exception-safety guarantee.

Friends And Related Symbol Documentation

◆ hashAppend

template<class HASHALG >
void hashAppend ( HASHALG &  hashAlg,
const Location  
)
friend

Pass the specified object to the specified hashAlg. This function integrates with the bslh modular hashing system and effectively provides a bsl::hash specialization for Location.

◆ swap

void swap ( Location ,
Location  
)
friend

Exchange the values of the specified a and b objects. This function provides the no-throw exception-safety guarantee.


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