Page MenuHomec4science

source.h
No OneTemporary

File Metadata

Created
Fri, Jan 3, 00:57

source.h

#ifndef __SOURCE_H__
#define __SOURCE_H__
#include "geom.h"
struct source
{
double temperature;
geom * bounds;
bool fixed;
// warning, passes bounds pointer ownership
source(double _T = 0, geom * _bounds = NULL, bool _fixed = false)
: temperature(_T), bounds(_bounds), fixed(_fixed)
{
}
source(const source&) = delete;
source& operator=(const source& s) = delete;
source(source&& s)
: bounds(s.bounds), temperature(s.temperature), fixed(s.fixed)
{
s.bounds = NULL;
}
~source()
{
if (bounds != NULL)
delete bounds;
}
bool inside(double x, double y) const
{
return bounds->inside(x, y);
}
};
std::istream& operator>>(std::istream& is, source& s);
std::ostream& operator<<(std::ostream& is, const source& s);
#endif

Event Timeline