Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6132179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:04:10+00:00 2026-05-23T17:04:10+00:00

I am going to write an adapter class. In this class there is an

  • 0

I am going to write an adapter class. In this class there is an xmlrpc-c server (abyss server). I want to start the server by creating a new thread, and the thread’s function is the member function XMLThreadFun().

When I try to use the code below there is an error at the line of the adapter’s constructor implementation:

/usr/include/boost/bind/bind.hpp:69:37: error: ‘void (Adapter::*)()’ is not a class, struct, or union type

Can anyone tell me how to solve this error, or how to achieve my goal? I really appreciate it.

Below is my code snippet:

#ifdef _MSC_VER
#pragma warning( disable : 4503 4355 4786 )
#else
#include "config.h"
#endif

#include "quickfix/FileStore.h"
#include "quickfix/SocketInitiator.h"
#include "quickfix/SessionSettings.h"
#include "Application.h"
#include <string>
#include <iostream>
#include <fstream>
#include "quickfix/SessionID.h"
#include "quickfix/Session.h"
#include "getopt-repl.h"


#include <cassert>
#include <xmlrpc-c/base.hpp>
#include <xmlrpc-c/registry.hpp>
#include <xmlrpc-c/server_abyss.hpp>



#include <boost/thread.hpp>
#include <boost/date_time.hpp>

using namespace std;
class theClient : public xmlrpc_c::method {
public:
    theClient() {}
    theClient(FIX::SocketInitiator* initiator) {
        set<FIX::SessionID> s(initiator->getSessions());
        set<FIX::SessionID>::iterator myIterator;
        for (myIterator = s.begin(); myIterator != s.end(); myIterator++) {
            string str(myIterator->getSenderCompID());
            clientname = str;
        }
    }

    void execute(xmlrpc_c::paramList const& paramList,
        xmlrpc_c::value *   const  retvalP) {
        *retvalP = xmlrpc_c::value_string(clientname);
    }

private:
    string clientname;

};

class Adapter {
private:
    xmlrpc_c::registry myRegistry;
    xmlrpc_c::methodPtr XMLRPCMethodP;
    xmlrpc_c::serverAbyss webServer;
    boost::thread webServerThread;
public:
    void initWebServer(string rpcHost, string rpcPort);
    void XMLThreadFun();
    Adapter(string rpcHost, string rpcPort);
};

Adapter::Adapter(string rpcHost, string rpcPort) : myRegistry(), XMLRPCMethodP(new theClient), webServer(myRegistry, 8181, "/tmp/xmlrpc_log"), webServerThread(boost::bind(&Adapter::XMLThreadFun, this, &webServer))
{
    initWebServer(rpcHost, rpcPort);
}

void Adapter::XMLThreadFun() {
    webServer->run();
}

void Adapter::initWebServer(string rpcHost, string rpcPort) {
    webServerThread.join();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:04:10+00:00Added an answer on May 23, 2026 at 5:04 pm

    You will need to use boost::bind to call a member function as a thread.
    Something like

    class MyClass {
    public: 
       void Start();
       void DoStuff( int limit );
    };
    
    MyClass foo;
    boost::thread thread1( boost::bind( &MyClass::Start, &foo ) );
    boost::thread thread2( boost::bind( &MyClass::DoStuff, &foo, 30 ) );
    // threads do stuff here
    thread1.join();
    thread2.join();
    

    Specifically here, it looks like you would change

    webServerThread( boost::bind( &Adapter::XMLThreadFun, this, &webServer)
    

    to

    webServerThread( boost::bind( &Adapter::XMLThreadFun, this )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new on this project and am going to write, what i thought was
We are going to write an entire new application for a reservation system. In
I'm going to write a function to play a mp3 file from an URL
I guess this is kind of a programming question, because I'm going to write
I want to write a function, and I want to learn about clarify and
I'm going to write simple c++ application, server-client, client-client. I would like to develop
I am going to write a smart client application. This application will be swing
I'm going to write an ftp client using .NET Framework. I want to upload
If, for example, you're going to write a variant type class, you will naturally
I am new to Image Processing and Machine Vision. I am going to write

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.