/**
\page yarp_code_examples Some examples

\tableofcontents

There are many code examples available in the `example/`
subdirectory of YARP. If you're reading
this online, click on the \ref examples "examples"
link to see many of them.

\section yarp_code_example_simple Simple port example

Here we work through an example of using YARP communication
between programs.  We will have two programs, a sender and receiver,
`simple_sender` and `simple_receiver`

\subsection yarp_code_example_simple_sender simple_sender

Here's `simple_sender/simple_sender.cpp`:

\snippet{lineno} example/os/simple_sender/simple_sender.cpp simple_sender simple_sender.cpp

`simple_sender/CMakeLists.txt`

\snippet{lineno} example/os/simple_sender/CMakeLists.txt simple_sender CMakeLists.txt


\subsection yarp_code_example_simple_receiver simple_receiver

Here's `simple_receiver/simple_receiver.cpp`:

\snippet{lineno} example/os/simple_receiver/simple_receiver.cpp simple_receiver simple_receiver.cpp

`simple_receiver/CMakeLists.txt`

\snippet{lineno} example/os/simple_receiver/CMakeLists.txt simple_receiver CMakeLists.txt


\subsection yarp_code_example_running Running the example

After compiling, on three separate
consoles, do:
\code{.sh}
 yarp server               # this starts the YARP name server
 ./simple_sender           # this runs the sender
 ./simple_receiver         # this runs the receiver
\endcode

Or in windows that would be:
\code{.sh}
 yarp.exe server           # this starts the YARP name server
 simple_sender.exe         # this runs the sender
 simple_receiver.exe       # this runs the receiver
\endcode

You'll need to be in the right directories to run the executables,
or have them in your path.

Here's what you should see on the terminal for the sender:
\verbatim
Sent message: testing 1 of 100
Sent message: testing 2 of 100
Sent message: testing 3 of 100
Sent message: testing 4 of 100
...
\endverbatim

Here's what you should see on the terminal for the receiver:
\verbatim
yarp: Receiving input from /sender to /receiver using tcp
Got message: testing 7 of 100
yarp: Removing input from /sender to /receiver
\endverbatim
You can run the receiver many times to connect and reconnect.



\section yarp_code_example_buffer Buffered port example

\snippet{lineno} example/os/buffered_port/buffered_port.cpp buffered_port buffered_port.cpp
\snippet{lineno} example/os/buffered_port/CMakeLists.txt buffered_port CMakeLists.txt

*/


/**
 * \example os/buffered_port/buffered_port.cpp

This example shows how to communicate between a pair of buffered ports.

*/



/**
 * \example os/simple_sender/simple_sender.cpp

This outputs some data to a port.
Designed to be used with \ref os/simple_receiver/simple_receiver.cpp example.

*/


/**
 * \example os/simple_receiver/simple_receiver.cpp

This reads some data from a port.
Designed to be used with \ref os/simple_sender/simple_sender.cpp example.

*/


/**
 * \example os/bottle_add/bottle_add.cpp

How to construct a very simple bottle.  See also \ref os/browse_bottle/browse_bottle.cpp example.

*/


/**
 * \example os/database/database.cpp

A toy "database" program for storing and fetching key-values, accessible
from a port.

*/


/**
 * \example os/image_process/image_process.cpp

An example of how to receive, process, and output images to and from a port.

*/


/**
 * \example os/image_process_module/image_process_module.cpp

This is the \ref os/image_process/image_process.cpp example rewritten as a "module".
It inherits better starting up, configuring, and shutting down behavior.

*/


/**
 * \example os/image_source/image_source.cpp

An example of how to create a source of images as a port.

*/



/**
 * \example os/make_count/make_count.cpp

Send countdown messages from a port (paired with \ref os/view_count.cpp
example).

*/

/**
 * \example os/view_count/view_count.cpp

View countdown messages coming from a port (paired with \ref os/make_count.cpp
example).

*/


/**
 * \example os/portable_pair/portable_pair.cpp

Show use of the yarp::os::PortablePair class, to send messages
of mixed type.  If the component types follow the YARP network
data format, then their composition will also.

*/



/**
 * \example os/periodicthread/periodicthread.cpp

Show a class for running some processing at a specified interval.

*/




/**
 * \example os/summer/summer.cpp

Add up numbers received on a port, and send the result back out.

*/



/**
 * \example os/threads/threads.cpp

Demonstrate the basic use of threads.  See also \ref os/periodicthread/periodicthread.cpp

*/


/**
 * \example os/browse_bottle/browse_bottle.cpp

Demonstrates one way to access bottle objects.  See also \ref os/bottle_add/bottle_add.cpp

*/


/**
 * \example dev/grabber_client/grabber_client.cpp

How to grab images from a remote source using the yarp::dev::IFrameGrabberImage
interface.

@sa yarp::dev::IFrameGrabberImage::getImage
*/

/**
 * \example dev/grabber_crop/grabber_crop.cpp

How to grab cropped images from a remote source using the
yarp::dev::IFrameGrabberImage interface.

@sa yarp::dev::IFrameGrabberImage::getImageCrop
*/

/**
 * \example dev/file_grabber/file_grabber.cpp

This example shows how we would make a new device for a camera.
We make a device that reads images from file.  The only step
missing here is to integrate the device into the YARP library.

Here's the header file, dev/file_grabber/FileFrameGrabber.h

\snippet dev/file_grabber/FileFrameGrabber.h

And here's how we can use it.  In fact, we just grab the first
image from the device.

*/


/**
 * \example dev/fake_motor/fake_motor.cpp

Some tips on how to create a device for a new motor control board.

*/


/**
 \example dev/motortest/motortest.cpp

Example showing how to use the SerialServoBoard driver AND how to configure and use the IPositionControl interface.
*/



/**
 * \example opencv/main.cpp

An example of using OpenCV with YARP.

*/



/**
 * \example property/main.cpp

How to read a configuration file.  This example is designed to
read a file like the following (property/config.txt):

\snippet example/property/config.txt

*/


/**
 * \example bottle/main.cpp

Experiment with bottles and properties.

*/



/**
 * \example framerate/main.cpp

Measure the framerate of a data source.  This example was originally
designed for images but should work with anything.

*/



/**
 * \example imagemagick/main.cpp

Using ImageMagick and YARP

*/



/**
 * \example external/nameclient.c

How to get data from YARP's name server without using any YARP code
in your own program.

*/





/**
 \example port_power/ex0000_receiver.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0001_sender.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0002_connector.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0100_receiver.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0101_sender.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0200_polling.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0300_port_callback.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0301_buffered_callback.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0302_buffered_ext_callback.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0400_expect_reply.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0401_give_reply.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0402_port_callback_reply.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0403_bufferedport_callback_reply.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0500_raw_target_receiver.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0501_raw_target_sender.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0502_raw_target_connector.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0503_serial_target_receiver.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0504_serial_target_sender.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0505_compliant_target_receiver.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0506_compliant_target_sender.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/



/**
 \example port_power/ex0507_alternative_compliant_target_receiver.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/ex0508_alternative_compliant_target_sender.cpp

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/TargetVer1.h

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/TargetVer1b.h

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/TargetVer2.h

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example port_power/TargetVer3.h

Part of a series of examples on the different ways of using
ports. See \link port_expert Port power tutorial\endlink.

*/


/**
 \example cuda/cuda_gpu.cpp

Example showing how to use the CUDA driver to execute custom code onto nVidia graphics cards (for supported cards, try to search on Google something like "cuda supported gpu")

*/


/**
 \example carrier/carrier_stub.cpp

Example showing how to add a new carrier to YARP.

*/
