473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

C++/Tcl/C++ Interface

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
Apr 10 '08 #1
1 2213
On Apr 10, 3:38 pm, Soumen <soume...@gmail.comwrote:
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.
Apr 10 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roy Pereira | last post by:
I have an application that is composed of a set of "Content" dlls and a viewer application. The viewer calls a standard set of functions that are present in all the dlls. I maintain this by...
9
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
4
by: Doug | last post by:
I am working on an existing .NET (C Sharp) component that had a com interface that was used by a VB component. When it was originally written, it had the SSEAssemblyCom class below - minus the two...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
6
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
20
by: Ole Hanson | last post by:
I am accessing my database through an interface, to allow future substitution of the physical datastore - hence I would like to declare in my Interface that my DAL-objects implementing the...
2
by: Alex Sedow | last post by:
Why interface-event-declaration does not support multiple declarators like event-declaration? Grammar from C# spec: variable-declarators: variable-declarator variable-declarators ","...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
8
by: rn5a | last post by:
Suppose I have the following class code: Imports System Imports System.Data Imports System.Data.SqlClient Public Class DBSettings Private sqlCmd As SqlCommand Private sqlConn As...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.