Embedded Programming
https://github.com/XuhuaHuang/EmbeddedProgramming
This repository hopefully can lead you through the modern C++ world, with some of its popular tool chains.
Each topic is placed in individual folder. Projects are placed under each descriptively-named folders.
Most of the directories are provided with a CMakeLists.txt.
Using CMake will be significantly easier than manually compiling all the files with your favorite compiler.
For your comfort, some of the files have required compilation command documented in the source file itself.
Table of Contents
- Embedded Programming
- Table of Contents
- Special Thanks
- Languages
- Getting Started
- Repository Directories
UtilHackerRankLeetCodePlaygroundObjectiveCProjects
- References
- Commonly Used Command in
CMake
- Commonly Used Command in
Special Thanks
Prof. Charmaine Jirgens
My mentor to the programming world
Professor, Electronics Engineering and Information Technology
Heritage College, Gatineau, Quebec, Canada
Software does not run in a magic fairy aether powered by the fevered dreams of CS PhDs.
Languages
C/C++, Objective-C/C++
{
public:
explicit person() = default;
explicit person(const std::string& fn, const std::string& ln)
: first(fn)
, last(ln)
{
}
explicit person(std::string&& fn, std::string&& ln)
: first(std::move(fn))
, last(std::move(ln))
{
}
person(const person& rhs) = default;
person& operator=(const person&) = default;
person(person&& rhs) noexcept = default;
person& operator=(person&& rhs) noexcept = default;
virtual ~person() noexcept = default;
[[nodiscard]] inline std::string& first_name() { return first; }
inline const std::string& first_name() const { return first; }
[[nodiscard]] inline std::string& last_name() { return last; }
inline const std::string& last_name() const { return last; }
private:
std::string first;
std::string last;
};
template<typename T>
concept printable = requires(T t) {
{ std::cout << t } -> std::convertible_to
}
struct print
{
constexpr print() = default;
template <typename T>
requires printable
inline constexpr void operator()(T const& t) const
{
std::cout << t << "\n";
}
};
Getting Started
Obtain vcpkg and Dependencies
git clone https://github.com/microsoft/vcpkg
cd vcpkg
bash ./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install gtest
./vcpkg install qt6
Example to Compile a File Named get_tie.cpp
cd ./StandardTemplateLibrary/Tuple
g++ -g -Wall -Wextra -Wpedantic -c get_tie.cpp -o get_tie.exe -std=gnu++2b
./get_tie
To Update MinGW on Windows
Run a PowerShell session with administrator privilege and run:
mingw-get update
mingw-get upgrade
# Verify the version of installed gcc and g++
gcc --version
g++ --version
Repository Directories
If you already have a configured CMake for your operating system, simple change to the directory with such CMakeLists.txt and run:
or
For example, change to directory ./DesignPatterns:
cmake ./CMakeLists.txt
The convention is to create a folder dedicated to CMake files, for example, build or bin:
mkdir build
cd build
cmake ../CMakeLists.txt -G "Visual Studio 17 2022"
To build with popular Ninja or MinGW generator:
cmake ../CMakeLists.txt -G "Ninja"
# With MinGW generator
cmake ../CMakeLists.txt -G "MinGW Makefiles"
To build the repository and run tests:
cd build
cmake --build .
ctest --verbose
Functionality provided by separate module. A namespace util is created to better manage the functions.
Tests and GoogleTest are located within the Util/tests folder.
namespace data_structure {}
namespace iife {}
namespace list {}
namespace math {
namespace cartesian_plane {}
namespace euclidean_space {}
}
namespace parse {}
namespace physics {}
namespace pointer {}
namespace range {}
namespace type {}
namespace type_safety {}
namespace vector {}
}
HackerRank
Contains solutions to some of the basic problem solving coding questions. Provided file name most likely describes the content.
The README.md has more handy notes when encountering those problems.
Click to see my HackerRank profile
LeetCodePlayground
Contains solutions to some of the basic problem solving coding questions.
Click to see my LeetCode profile
ObjectiveC
Popular concepts in Objective-C.
Compiled in Windows using GNUstep Core and provided GNUstep developer tools.
Projects
Contains projects carried along the coursework and includes some personal project as well.
For example, building a terminal progress bar for visual effects and working with OpenGL library in C++.