Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++/Tcl/C++ Interface

Reply
Thread Tools

C++/Tcl/C++ Interface

 
 
Soumen
Guest
Posts: n/a
 
      04-10-2008
Hi,

Not sure if this most appropriate group for this post. But I've seen
couple of posts related to C++/Tcl in this group. And that makes me
post this query in this group. Please redirect me to correct group
if this is not the most appropriate one.

I'm a newbie in Tcl and Tcl/C++ interfacing. I need to develop a
prototype for one of our upcoming project.

I've a shared library which provides Tcl procedures to traverse
through some graph which is being created upon reading a file
of specific format. If I load this shared library in Tcl shell and
call those proc to read the specific file and traverse the graph.

Graph traversal proc are like:
* getting neighbor nodes of a given node
* getting the node name and edge names to/from a node

Let's name this Tcl library GL (graph lib).

Now, in my C++ program I need create a duplicate graph since I don't
have capability read that file directly. So from my C++ code, I need
to
create a Tcl channel, send commands through the Tcl channel for GL
procs and get information from those GL procs to my C++ application
to build a duplicate graph on my end.

Could some one provide hints how to go about this? Any pointers to
existing resource (doc/open source code) will be very helpful.

Regards,
~ Soumen
 
Reply With Quote
 
 
 
 
Soumen
Guest
Posts: n/a
 
      04-10-2008
On Apr 10, 3:38 pm, Soumen <(E-Mail Removed)> wrote:
> Hi,
>
> Not sure if this most appropriate group for this post. But I've seen
> couple of posts related to C++/Tcl in this group. And that makes me
> post this query in this group. Please redirect me to correct group
> if this is not the most appropriate one.
>
> I'm a newbie in Tcl and Tcl/C++ interfacing. I need to develop a
> prototype for one of our upcoming project.
>
> I've a shared library which provides Tcl procedures to traverse
> through some graph which is being created upon reading a file
> of specific format. If I load this shared library in Tcl shell and
> call those proc to read the specific file and traverse the graph.
>
> Graph traversal proc are like:
> * getting neighbor nodes of a given node
> * getting the node name and edge names to/from a node
>
> Let's name this Tcl library GL (graph lib).
>
> Now, in my C++ program I need create a duplicate graph since I don't
> have capability read that file directly. So from my C++ code, I need
> to
> create a Tcl channel, send commands through the Tcl channel for GL
> procs and get information from those GL procs to my C++ application
> to build a duplicate graph on my end.
>
> Could some one provide hints how to go about this? Any pointers to
> existing resource (doc/open source code) will be very helpful.
>
> Regards,
> ~ Soumen


Clarifying the requirement further:
-----------------------------------

Say there is a text file of specific format. And the shared library
(GL) is say a standard reader of that specific format. Now, when I
load this GL.so in tcl shell, and call procedure to read a file of
the specific format, it internally builds a graph. I've some gl_*
procedures to traverse that graph.

Now, my objective is from C++ program, create a tcl channel and send
commands to read that specific file, to iterate over the graph using
gl_* procs. Get the required information (o/p of those gl_* tcl procs)
in the C++ program to mimic the graph of Tcl env in C++ env.

For example (this is not the exact case) following file is the
specific format and it represents an adjacency list.

a ->b ->c
b ->c
c -> a ->d
d -> a -> b

Now, in the GL.so, I've following Tcl procs:

gl_read_file ---> reads the adjacency list file
gl_get_nodes ---> returns a list of node
gl_get_node_name ---> gives node name of Tcl node obj
gl_get_neighbor_nodes ---> gives a Tcl list of adjacent nodes of a
specified node name (or Tcl node obj)
gl_get_edge ---> gives Tcl edge object connecting two node obj
gl_get_edge_name ---> gives the edge name of Tcl edge object
gl_get_out_edge ---> gives list of Tcl edge objects which are outgoing
edge of specified node.

Now, in my C++ program I need to create the same graph. But I don't
have capability of reading this file format. So what I need to do
create some tcl channel, call required gl_* Tcl proc to create
the same graph using C++ objects so that later in C++ program
I can only use the graph in C++ env to do further processing.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Going from higher security level interface to lower security interface- HELP!!! - AM Cisco 4 12-28-2004 09:52 PM
PCI interface or USB interface David Wireless Networking 4 09-16-2004 01:01 PM
allow ssh only on outside interface, but telnet on inside interface of router no-one Cisco 0 07-28-2004 04:17 PM
PIX: how to allow 1 host from outside interface to access another host on the inside interface? jonnah Cisco 1 04-21-2004 02:26 PM
static nat between phisical interface and virtual interface on same ethernet Andrea Cisco 0 04-19-2004 09:37 AM



Advertisments