Vowpal Wabbit
Public Member Functions | Private Attributes | List of all members
VW::vw_exception Class Reference

#include <vw_exception.h>

Inheritance diagram for VW::vw_exception:
VW::strict_parse_exception VW::vw_argument_disagreement_exception VW::vw_argument_invalid_value_exception VW::vw_unrecognised_option_exception

Public Member Functions

 vw_exception (const char *file, int lineNumber, std::string const &message) noexcept
 
 vw_exception (const vw_exception &ex) noexcept
 
vw_exceptionoperator= (const vw_exception &other) noexcept
 
 ~vw_exception () noexcept override
 
const char * what () const noexcept override
 
const char * Filename () const
 
int LineNumber () const
 

Private Attributes

const char * file
 
std::string message
 
int lineNumber
 

Detailed Description

Definition at line 22 of file vw_exception.h.

Constructor & Destructor Documentation

◆ vw_exception() [1/2]

VW::vw_exception::vw_exception ( const char *  file,
int  lineNumber,
std::string const &  message 
)
noexcept

Definition at line 10 of file vw_exception.cc.

11  : file(pfile), message(pmessage), lineNumber(plineNumber)
12 {
13 }
std::string message
Definition: vw_exception.h:28
const char * file
Definition: vw_exception.h:26

◆ vw_exception() [2/2]

VW::vw_exception::vw_exception ( const vw_exception ex)
noexcept

Definition at line 15 of file vw_exception.cc.

16  : file(ex.file), message(ex.message), lineNumber(ex.lineNumber)
17 {
18 }
std::string message
Definition: vw_exception.h:28
const char * file
Definition: vw_exception.h:26

◆ ~vw_exception()

VW::vw_exception::~vw_exception ( )
overridedefaultnoexcept

Referenced by operator=().

Member Function Documentation

◆ Filename()

const char * VW::vw_exception::Filename ( ) const

Definition at line 37 of file vw_exception.cc.

References file.

Referenced by main(), and parse_dispatch().

37 { return file; }
const char * file
Definition: vw_exception.h:26

◆ LineNumber()

int VW::vw_exception::LineNumber ( ) const

Definition at line 39 of file vw_exception.cc.

References lineNumber, sprintf_s, THROW, and vsprintf_s.

Referenced by main(), and parse_dispatch().

39 { return lineNumber; }

◆ operator=()

vw_exception & VW::vw_exception::operator= ( const vw_exception other)
noexcept

Definition at line 20 of file vw_exception.cc.

References file, and ~vw_exception().

Referenced by VW::vw_argument_disagreement_exception::operator=(), VW::vw_argument_invalid_value_exception::operator=(), VW::vw_unrecognised_option_exception::operator=(), and VW::strict_parse_exception::operator=().

21 {
22  // check for self-assignment
23  if (&other == this)
24  return *this;
25 
26  file = other.file;
27  message = other.message;
28  lineNumber = other.lineNumber;
29 
30  return *this;
31 }
std::string message
Definition: vw_exception.h:28
const char * file
Definition: vw_exception.h:26

◆ what()

const char * VW::vw_exception::what ( ) const
overridenoexcept

Definition at line 35 of file vw_exception.cc.

References message.

Referenced by VW::config::options_boost_po::add_and_parse(), main(), and parse_dispatch().

35 { return message.c_str(); }
std::string message
Definition: vw_exception.h:28

Member Data Documentation

◆ file

const char* VW::vw_exception::file
private

Definition at line 26 of file vw_exception.h.

Referenced by Filename(), and operator=().

◆ lineNumber

int VW::vw_exception::lineNumber
private

Definition at line 31 of file vw_exception.h.

Referenced by LineNumber().

◆ message

std::string VW::vw_exception::message
private

Definition at line 28 of file vw_exception.h.

Referenced by what().


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