Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
model_car_drivers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
ADC
libraries
model_car_drivers
Commits
c91690b4
Commit
c91690b4
authored
4 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Removed the exceptions module because it was not used.
parent
ec39ce24
No related branches found
No related tags found
1 merge request
!1
Sergi
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/model_car_exceptions.h
+0
-81
0 additions, 81 deletions
include/model_car_exceptions.h
src/model_car_exceptions.cpp
+0
-22
0 additions, 22 deletions
src/model_car_exceptions.cpp
with
0 additions
and
103 deletions
include/model_car_exceptions.h
deleted
100644 → 0
+
0
−
81
View file @
ec39ce24
#ifndef MODEL_CAR_EXCEPTIONS
#define MODEL_CAR_EXCEPTIONS
#include
"exceptions.h"
#include
<stdint.h>
/**
* \brief CModel_Car_Drivers_Base exception class
*
* This class implements the exceptions for the CModel_Car_Drivers_Base class.
*
* Similarly to other exception classes, it appends a class identifer
* string ("[CModel_Car_Drivers_Base] - ") to the error message in order to identify the
* class that generated the exception.
*
* The base class can be used to catch any exception thrown by the application
* or also, this class can be used in order to catch only exceptions generated
* by CModel_Car_Drivers_Base objects.
*
*/
class
CModelCarException
:
public
CException
{
public:
/**
* \brief Constructor
*
* The constructor calls the base class constructor to add the general
* exception identifier and then adds the class identifier string
* "[CModel_Car_Drivers_Base class]" and the supplied error message.
*
*
* \verbatim
* [Exception caught] - <where>
* [CModel_Car_Drivers_Base class] - <error message>
* \endverbatim
*
* \param where a null terminated string with the information about the name
* of the function, the source code filename and the line where
* the exception was generated. This string must be generated
* by the _HERE_ macro.
*
* \param error_msg a null terminated string that contains the error message.
* This string may have any valid character and there is no
* limit on its length.
*
*
*/
CModelCarException
(
const
std
::
string
&
where
,
const
std
::
string
&
error_msg
);
/**
* \brief Constructor
*
* The constructor calls the base class constructor to add the general
* exception identifier and then adds the class identifier string
* "[CModel_Car_Drivers_Base class]", the supplied error message and the hexadecimal message received.
*
*
* \verbatim
* [Exception caught] - <where>
* [CModel_Car_Drivers_Base class] - <error message>
* [Serial message] - <serial_msg>
* \endverbatim
*
* \param where a null terminated string with the information about the name
* of the function, the source code filename and the line where
* the exception was generated. This string must be generated
* by the _HERE_ macro.
*
* \param error_msg a null terminated string that contains the error message.
* This string may have any valid character and there is no
* limit on its length.
*
* \param serial_msg Pointer to the message received by Serial port.
*
* \param msg_length Serial message length.
*
*/
CModelCarException
(
const
std
::
string
&
where
,
const
std
::
string
&
error_msg
,
const
uint8_t
*
serial_msg
,
uint8_t
msg_length
);
};
#endif
This diff is collapsed.
Click to expand it.
src/model_car_exceptions.cpp
deleted
100644 → 0
+
0
−
22
View file @
ec39ce24
#include
"model_car_exceptions.h"
#include
<string.h>
#include
<stdio.h>
#include
<iomanip>
const
std
::
string
model_car_driver_base_exception_msg
=
"[CModel_Car_Drivers_Base class] - "
;
CModelCarException
::
CModelCarException
(
const
std
::
string
&
where
,
const
std
::
string
&
error_msg
)
:
CException
(
where
,
model_car_driver_base_exception_msg
)
{
this
->
error_msg
+=
error_msg
;
}
CModelCarException
::
CModelCarException
(
const
std
::
string
&
where
,
const
std
::
string
&
error_msg
,
const
uint8_t
*
serial_msg
,
uint8_t
msg_length
)
:
CException
(
where
,
model_car_driver_base_exception_msg
)
{
this
->
error_msg
+=
error_msg
;
std
::
ostringstream
ss
;
for
(
uint8_t
i
=
0
;
i
<
msg_length
;
i
++
)
ss
<<
"0x"
<<
std
::
hex
<<
std
::
setw
(
2
)
<<
std
::
setfill
(
'0'
)
<<
(
int
)
serial_msg
[
i
];
std
::
string
msg_string
(
ss
.
str
());
this
->
error_msg
+=
"
\n
[Serial message] - "
;
this
->
error_msg
+=
msg_string
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment