c++

What does a GCC compiled static library contain?

My application links against libsamplerate.a. I am doing this to make distributing the final binary easier. I am worried that perhaps the code inside the .a file depends on some other libraries I also will need to distribute. But if it doesn't I am worried I am bloating up my application too much by including multiple copies of eg. lib...

Multiple Inheritance from two derived classes

I have an abstract base class which acts as an interface. I have two "sets" of derived classes, which implement half of the abstract class. ( one "set" defines the abstract virtual methods related to initialization, the other "set" defines those related to the actual "work". ) I then have derived classes which use multiple inheritance ...

choosing a SOAP library to integrate with ISAPI webapp

Hi, The company I work for has a large webapp written in C++ as an ISAPI extension (not a filter). We're currently enhancing our system to integrate with several 3rd party tools that have SOAP interfaces. Rather than roll our own, I think it would probably be best if we used some SOAP library. Ideally, it would be free and open source...

Referencing existing SWIG wrappers when creating new ones

I have an existing library (JPhysX) that is a Java wrapper for a native C++ library (PhysX). The Java library makes use of types generated by SWIG, for example, com.jphysx.SWIGTYPE_p_NxStream, which represents a pointer to an NxStream object in the C++ code. Now I want to create my own C++ class that inherits from the C++ type NxStream, ...

Is it possible to make a vs2008 c++ project import source file names from another file?

I have a situation where another developer is including source files from a project that I maintain in a project that he maintains. The nature of the files is such that each source file registers a "command" in an interpretive environment so all you have to do is link in a new source file to register a new "command". We can't put these...

Non-GPL JSON-RPC library for C++

What non-GPL libraries are available for writing JSON-RPC servers and clients in native C++? According to http://json-rpc.org/wiki/implementations, there seems to only exist one implementation of JSON-RPC for C++, namely JsonRpc-Cpp, but that only available under GPL. Unfortunately we cannot use GPL code in our software. The JSON RPC C...

Odd behavior from TinyXML++

Hoping some of you TinyXML++ people can help me out. Really, since you recomended to me before I think you owe me ;) I have the following code: //ticpp::Iterator< ticpp::Element > child( "SetPiece" ); ticpp::Iterator< ticpp::Node > child("SetPiece"); GLuint lc_SPieces = 0; for(child = child.begin( this ); child != child....

C++: dynamically allocating an array of objects?

This is kind of a beginners question, but I haven't done C++ in a long time, so here goes... I have a class that contains a dynamically allocated array, say class A { int* myArray; A() { myArray = 0; } A(int size) { myArray = new int[size]; } ~A() { // Note that as per MikeB's...

How can I count operations in C++?

How can I count operations in C++? I'd like to analyze code in a better way than just timing it since the time is often rounded to 0 millisec. ...

Can you call Ada functions from C++?

I'm a complete Ada newbie, though I've used Pascal for 2-3 years during HS. IIRC, it is possible to call Pascal compiled functions from C/C++. Is it possible to call procedures & functions written in Ada from C++? ...

What C/C++ compilers are available for VxWorks?

I'm new to the VxWorks environment, I'm wondering what C and C++ compilers are available for use with VxWorks? ...

Parallel Programming and C++

I've been writing a lot recently about Parallel computing and programming and I do notice that there are a lot of patterns that come up when it comes to parallel computing. Noting that Microsoft already has released a library along with the Microsoft Visual C++ 2010 Community Technical Preview (named Parallel Patterns Library) I'm wonder...

Is std::string size() a O(1) operation?

Is std::string size() a O(1) operation? The implementation of STL I'm using is the one built into VC++ ...

How can I increase the performance in a map lookup with key type std::string?

I'm using an std::map (VC++ implementation) and it's a little slow for lookups via the map's find method. The key type is an std::string. Can I increase the performance of this std::map lookup via a custom key compare override for the map? For example, maybe std::string < compare doesn't take into consideration a simple string::size()...

how to install boost to the VS 2008?

I`ve almost completely install Boost but I have a problem which is how to set path to Boost in Tools->options->projects->VC++ Directories. I`ve written the path to include files and libraries (my folder contains of two subfolders which is 'lib' and 'include'), but when I try to use Boost include boost/regex.hpp> I got this linking err...

How much memory does a thread consume when first created?

I understand that creating too many threads in an application isn't being what you might call a "good neighbour" to other running processes, since cpu and memory resources are consumed even if these threads are in an efficient sleeping state. What I'm interested in is this: How much memory (win32 platform) is being consumed by a sleepin...

Register allocation rules in code generated by major C/C++ compilers

I remember some rules from a time ago (pre-32bit Intel processors), when was quite frequent (at least for me) having to analyze the assembly output generated by C/C++ compilers (in my case, Borland/Turbo at that time) to find performance bottlenecks, and to safely mix assembly routines with C/C++ code. Things like using the SI register f...

Best way to represent a 2-D array in C++ with size determined at run time

In C++ I'd like to do something like: int n = get_int_from_user(); char* matrix = new char[n][n]; matrix[0][0] = 'c'; //... matrix[n][n] = 'a'; delete [][] matrix; but of course this doesn't work. What is the best way to do something similar? I've seen some solutions to this but they seem pretty messy. ...

Approaching STL algorithms, lambda, local classes and other approaches.

One of the things that seems to be necessary with use of STL is a way to specify local functions. Many of the functions that I would normally provide cannot be created using STL function object creation tools ( eg bind ), I have to hand roll my function object. Since the C++ standard forbids local types to be used as arguments in templa...

How to use boost::mpl to compose policies?

I have used something like the following to compose policies for my application: The policy classes look like this: struct Policy { static void init(); static void cleanup(); //... }; template <class CarT, class CdrT> struct Cons { static void init() { CarT::init(); CdrT::init(); } static void cleanup() { CdrT:...