I'm working with IPlug.I want to import WDF++ to IPlug.But i have trouble with strings.
Using #include <string> to use std::string but i can't change "String::empty".Getting errors.
Can you help me about it?
Thanks.
Code: Select all
template <typename T>
class OnePort
{
public:
OnePort (T R, String n = String::empty)
: _name (n), Rp (R), a (0), b (0), port(this) {}
//----------------------------------------------------------------------
virtual String name () const { return _name.isEmpty() ? label() : _name; }
virtual String label () const = 0;
//----------------------------------------------------------------------
virtual inline void incident (T wave) = 0;
//----------------------------------------------------------------------
virtual inline T reflected () = 0;
//----------------------------------------------------------------------
virtual T R () { return port->Rp; } // Port resistance
virtual T G () { return 1.0 / port->Rp; } // Port conductance (inv.Rp)
//----------------------------------------------------------------------
virtual void connect (OnePort<T>* other)
{
port = other;
other->port = this;
}
//----------------------------------------------------------------------
T voltage () // v
{
return (port->a + port->b) / 2.0;
}
//----------------------------------------------------------------------
T current () // i
{
return (port->a - port->b) / (port->Rp + port->Rp);
}
//----------------------------------------------------------------------
protected:
//----------------------------------------------------------------------
String _name; // Port name
T Rp; // Port resistance
//----------------------------------------------------------------------
T a; // incident wave (incoming wave)
T b; // reflected wave (outgoing wave)
//----------------------------------------------------------------------
OnePort<T>* port; // internal pointer (used for direct connect form)
//----------------------------------------------------------------------
};