exceptions.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdexcept>
4 
5 namespace visionx::voxelgrid
6 {
7  class VoxelGridStructure;
8 }
9 
11 {
12 
13  /**
14  * @brief Base class for exceptions in this library.
15  */
16  class VoxelGridError : public std::runtime_error
17  {
18  public:
19  using std::runtime_error::runtime_error;
20  };
21 
22  /**
23  * @brief Indicates that voxel data with an invalid number of voxels
24  * has been passed to a VoxelGrid.
25  */
27  {
28  public:
29  InvalidVoxelDataSize(std::size_t actual, std::size_t expected);
30 
31  private:
32  std::string makeMsg(std::size_t actual, std::size_t expected);
33  };
34 
35  /**
36  * @brief Indicates that a voxel grid structure should have matched
37  * another one, but did not.
38  */
40  {
41  public:
42  InvalidStructure(const VoxelGridStructure& expected,
43  const VoxelGridStructure& actual,
44  const std::string& message = "Voxel grid structure does not match.");
45 
46  private:
47  std::string makeMsg(const VoxelGridStructure& expected,
48  const VoxelGridStructure& actual,
49  const std::string& message);
50  };
51 
52 
53 } // namespace visionx::voxelgrid::error
visionx::VoxelGridStructure
voxelgrid::VoxelGridStructure VoxelGridStructure
Definition: VoxelGridCore.h:36
visionx::voxelgrid::error::InvalidStructure::InvalidStructure
InvalidStructure(const VoxelGridStructure &expected, const VoxelGridStructure &actual, const std::string &message="Voxel grid structure does not match.")
Definition: exceptions.cpp:24
visionx::voxelgrid::error
Definition: exceptions.cpp:7
message
message(STATUS "Boost-Library-Dir: " "${Boost_LIBRARY_DIRS}") message(STATUS "Boost-LIBRARIES
Definition: CMakeLists.txt:8
visionx::voxelgrid::error::InvalidVoxelDataSize
Indicates that voxel data with an invalid number of voxels has been passed to a VoxelGrid.
Definition: exceptions.h:26
visionx::voxelgrid
Definition: exceptions.cpp:7
visionx::voxelgrid::error::InvalidVoxelDataSize::InvalidVoxelDataSize
InvalidVoxelDataSize(std::size_t actual, std::size_t expected)
Definition: exceptions.cpp:10
visionx::voxelgrid::VoxelGridStructure
Geometric structure of a 3D voxel grid.
Definition: VoxelGridStructure.h:94
visionx::voxelgrid::error::VoxelGridError
Base class for exceptions in this library.
Definition: exceptions.h:16
visionx::voxelgrid::error::InvalidStructure
Indicates that a voxel grid structure should have matched another one, but did not.
Definition: exceptions.h:39