postyyyman


Introduction

postyyyman is a C++ library that extents the possibilities of libsigc++ http://libsigc.sourceforge.net/ to also being able to send signals through binary streams. This is especially useful if you want to send signals through TCP streams.

you should also read the introduction of the STL manual http://www.sgi.com/Technology/STL/stl_introduction.html to understand generic programming and the terms i use in this document. Read especially the part about "Concepts and Modelling" and "Refinement".

now you can read the CONCEPTS file. and the CONCEPTIMPL file to see implemented concepts. or the CONCEPTSCHED file to see what a scheduler here is.

you can also dive into the tests/gtk directory and start the compile.sh script or edit compcommon.sh first to adapt it to your system. then execute gtkserver and gtkclient programs and see what happens. then read their source to see what the idea is. but you need not use GTK for postyyyman. see the tests/plain directory for a server and a client program that are plain simple console programs. you can enter text in the server.

i must admit that my documentation is not very structured as you see. and it also is a littl' incomplete. While reading and thinking, never forget that the main idea is to be able to connect libsigc++ signals through the network. and the other main point is the scheduler. is is something like a select wrapper now have fun with the stuff!

Now, how do i use it ?

Let's say you have two computers. CA and CB. they are connected by a TCP stream, and both are running your software. on CA you have a signal SI. you want to connect it to the slot SL on CB.
first you create a postman class (it's in the library) on both CA and CB. let's call them PA and PB.
now in PA you create a so called sender. you connect SI to your new sender in PA.
in PB you create a so called receiver. you connect your new receiver in PB to SL.
now if SI emits, the signal gets sent to PA. PA sends the stuff to PB. PB now emits the receiver which is connected to SL.

the postman has the concept of address and data. you can specify your type of address. for example uint8 or string if you want. and then you can say: at address 8 there shall be coconuts sent, and on address 22 i want to receive strings.
or if you used string as the type of address you can say: at address "hello" there shall be coconuts sent, and on address "foobar" i want to receive strings.
if CA says "on 10 i want to get uint8" and CB says "on 10 i send strings" then there will be a conflict of course. you need to have a appendtobinbuffer and a readfrombinbuffer routine for each data type you want to transmit. now what will happen is that the readfrombinbuffer routine on CA for uint8 will receive the data sent by the appendtobinbuffer routine for strings on CB. depending on their implementations they can return an error or receive garbage. this depends on you. see postman/yyysendables.*

heheh i just don't know where to start and where to stop. did you know that you can have multiple schedulers in the same application with multiple different kinds of binbuffers ? did you know you can write a FTP client with this library? (ADDRESS=char[4], DATA=string or other designs ;) oh oh.. :)

words of wisdom

the library is well designed i suppose. i KNOW that the documentation sucks. please send me questions about the parts you don't understand. and please read the example programs. they are extremly short and powerful examples.

** Directory structure

postyyyman is split into several groups and you just pick out the ones you need. it is not really a library. most things are just template classes and cannot be a real library anyway. if you want to use postyyyman in your own programs, just symlink the needed files into your own sources. then whenever there is a postyyyman update you just unpack the new one and due to the fact that you used symlinks, you automatically have the new version once you recompile your program. this means you do not bother your users with another another another library.

**** common

here we have common stuff like error handling etc.

**** postman

this is it! see postman.html

**** network

here we have binstream concept implementation over TCP/IP

**** the scheduler implementations

implementations of the scheduler concept for various environments you want to work in.

****** plain

just a good old raw program without all those modern style GUI lib stuffs inside.

****** gtk

this one works both with GTK and GTK--.

****** qt

this does not work. it's just started work.

**** tests

see here for examples.

****** plain

example for plain style program

****** gtk

example for GTK-- program

****** qt

this not works yet completely. and probably perhaps never will, because maybe i won't finish it.