Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // <---------- header.hpp
- #pragma once
- #inclide <some_lib.h>
- namespace MyNamespace {
- /**
- * Info about class
- * @author Vasya Pupkin (email@email.info) 2020
- */
- class SomeClass {
- private:
- static constexpr int COMPILE_TIME_CONSTANT = 100000;
- // Initialized from constructor
- static const int RUNTIME_CONSTANT;
- double z;
- public:
- /**
- * Info
- * @param constant_value Sth about it
- * @param z_value It's z_value woohoo_poohoo
- */
- SomeClass(int constant_value, double z_value)
- : RUNTIME_CONSTANT(constant_value)
- , z(z_value);
- /**
- * Info
- * @param z_new It's z_new woohoo_poohoo
- */
- void setZ(double z_new) noexcept;
- /**
- * Info
- * @return Z coordinate
- */
- double getZ() const noexcept;
- // Something else...
- protected:
- // Protected methods..
- private:
- // Private methods...
- }
- }
- // <---------- header.cpp
- #include "header.hpp"
- MyNamespace::SomeClass::SomeClass(int constant_value, double z_value) {
- // constructor body
- }
- void MyNamespace::SomeClass::setZ(double z_new) noexcept {
- z = z_new;
- }
- int MyNamespace::SomeClass::getZ() const noexcept {
- return z;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement