Skip to content
apidoc-c and apidoc-cpp samples

geo/shapes::geo #

enum Color #

enum class Color : unsigned char

Ways to paint.

variant Red #

Red = 1

Warm.

variant Green #

Green

Calm.

variant Blue #

Blue = 7

Cool.

struct Point #

struct Point

A point in the plane.

Points are values: copy them freely.

field x #

double x = 0

Across.

field y #

double y = 0

Up.

method norm #

double norm() const noexcept

How far from the origin.

class Shape #

class Shape

Anything with an area, see Circle.

Derive from it and implement area().

constructor Shape #

explicit Shape(Point center)
Shape(const Shape &other) = default

Makes one at center.

method ~Shape #

virtual ~Shape()

method area #

virtual double area() const = 0

The area.

Returns

The area, in square units.

method paint #

void paint(Color color, int times = 1)
void paint(const char *name)

Paints it.

Parameters

color

The color.

times

How many coats.

field count #

static unsigned long count

How many there are.

class Circle #

class Circle final : public Shape

A round shape.

constructor Circle #

Circle(Point center, double radius)

Makes one.

Parameters

center

Where.

radius

How big.

Raises

invalid_argument

If radius is negative.

method area #

double area() const override

The area.

Returns

The area, in square units.

method radius #

double radius() const

The radius.

function largest #

template <typename It>
It largest(It first, It last)

Deprecated

Use largest_of instead.

The largest of some shapes.

Parameters

first

The first.

last

Past the last.

Type parameters

It

An iterator over shape pointers.

Returns

The largest, or last if there are none.

struct List #

template <typename T>
struct List

A list of things.

field items #

T *items

The things.

field size #

unsigned long size

How many.

type alias Registry #

using Registry = List<Shape *>

Shapes, by pointer.

struct Sides #

template <int N>
struct Sides

How many sides a regular shape has.

constant value #

static constexpr int value = N

The number.

constant pi #

constexpr double pi = 3.14159265358979

The circle's constant.