Code View

plugin / plugin-2.2.0.0 / example / plugin / Circle.cpp
// SPDX-License-Identifier: MIT
#include "Circle.hh"

#include <plugin/PluginRegister.hh>

#include "Shape.hh"

namespace plugin
{
  namespace example
  {
    Circle::Circle( )
      : radius( 0 )
    {
    }

    Circle::Circle( Config const& cfg )
      : radius( cfg.r )
    {
    }

    Circle::Circle( Circle const& object )
      : Shape( object ),
        radius( object.radius )
    {
    }

    void Circle::setSize( unsigned int value )
    {
      radius = value;
    }

    unsigned int Circle::getSize( ) const
    {
      return radius;
    }

    void Circle::printOn( std::ostream& stream ) const
    {
      stream << "Circle r:" << radius << '\n';
    }

    REGISTER_WITH_CONFIG( Circle, Shape, Circle::Config );
  }  // namespace example
}  // namespace plugin