Sometimes I run into situations like this:
#ifndef CRIARVENDA_H
#define CRIARVENDA_H
#include <QDialog>
#include "cliente.h"
namespace Ui {
class CriarVenda;
}
class CriarVenda : public QDialog
{
Q_OBJECT
public:
explicit CriarVenda(QWidget *parent = 0);
~CriarVenda();
private:
Ui::CriarVenda *ui;
Cliente *cliente;
};
#endif // CRIARVENDA_H
in this case
namespace Ui {
class CriarVenda;
}
It is created a kind of a prototype of a class that will still be created which does not make much sense.
In this case it still does not make sense yet, where it creates a "Prototype class"
#ifndef CPU_HPP
#define CPU_HPP
#include <array>
#include <cstdint>
#include <functional>
class GameBoy;
Create a pointer to it
GameBoy* gameboy;
public:
CPU( GameBoy& core );
#include "GameBoy.hpp"
#include "CPU.hpp"
#include "RAM.hpp"
CPU::CPU( GameBoy& core ) :
gameboy( &core ) {
initOpcodeArray();
}
std::uint8_t CPU::readMem( std::uint16_t address ) {
gameboy->ram.readMem( address );
}
void CPU::writeMem( std::uint16_t address, std::uint8_t value ) {
gameboy->ram.writeMem( address, value );
}
Then call up the members of the class.
What is the name of this? I'm looking at some C ++ books I have and I do not see anything like that, and what's the use?