Help to fill the interface classes
I have the following interface files
Code:
class IMask
{
public:
using value_type = double;
virtual ~IMask() {}
// [0, 360) in ascending order
// nullptr if no values
virtual const value_type* getAngles() const = 0;
// Loss for each angle (positive dBi value)
// nullptr if no values
virtual const value_type* getValues() const = 0;
// May be 0
virtual size_t getValueCount() const = 0;
};
class IAntennaPattern
{
public:
virtual ~IAntennaPattern() {}
// Antenna pattern gain (dBi)
virtual double getGain() const = 0;
// Horizontal mask (clockwise, aligned to positive y axis)
virtual const IMask* getHorizontalMask() const = 0;
// Vertical mask
virtual const IMask* getVerticalMask() const = 0;
};
class ITransmitter
{
public:
// Returns the transmitter's position in meters.
virtual const double3& getPosition() const = 0;
// Returns the transmitter's frequency in MHz.
virtual unsigned int getFrequencyMHz() const = 0;
// Mechanical downtilt in °. Positive values => down, negative values => up.
// Must not be called when model is unmasked
virtual double getTilt() const = 0;
// Azimuth in ° (clockwise, aligned to positive y axis).
// Must not be called when model is unmasked
virtual double getAzimuth() const = 0;
// Antenna pattern
// Must not be called when model is unmasked
virtual const IAntennaPattern* getAntennaPattern() const = 0;
virtual ~ITransmitter() {}
};
I need to give the input in the following format
Code:
struct CalculationInput
{
ITransmitter* transmitter;
IReceiver* receiver;
};
TestFunction
{
velox::propagation_api::CalculationInput input;
velox::propagation_api::CalculationOutput out;
BSTR errorMessage=L"test error message";
model.calculateGrid(input, out, &errorMessage);
}
What is the best way to fill some data for the input.
Currently I added implementation classes for all the interface classes.like
Code:
template <typename T>
class EmptyMask:velox::propagation_api::IMask
{
private:
int num_values;
T values[100];
public:
EmptyMask() { num_values = 0; };
~EmptyMask() {};
// [0, 360) in ascending order
// nullptr if no values
const T* getAngles() const { return 0; };
// Loss for each angle (positive dBi value)
// nullptr if no values
const T* getValues() const { return ; };
// May be 0
size_t getValueCount() const { return num_values; };
};
Is there any better way. It is quite urgent