Skip to content

Instantly share code, notes, and snippets.

@below
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save below/61893c803431c3a730e2 to your computer and use it in GitHub Desktop.
Save below/61893c803431c3a730e2 to your computer and use it in GitHub Desktop.
nm output
#include <boost/shared_ptr.hpp>
#include <configuration/api/IConfigurationReport.hpp>
namespace whisper
{
namespace configuration
{
using boost::shared_ptr;
using whisper::configuration::PConfigurationReport;
/**
* Forward declaration for typedef.
*/
class IProgressMonitor;
/**
* Convenience type definition.
*/
typedef shared_ptr<IProgressMonitor> PProgressMonitor;
/**
* Call back monitor for the configuration progress.
*/
class IProgressMonitor
{
public:
/**
* Constructor
*/
explicit IProgressMonitor()
{
}
/**
* Destructor.
*/
virtual ~IProgressMonitor() throw ()
{
}
/**
* Callback method for indicating the progress of the executed sub step of the configuration progress.
*
* @param step - the step.
* @param stepCount - the step count.
*/
virtual void progressPerformed(int step, int stepCount) = 0;
/**
* Callback method for indicating the end of the progress operation. Is called at the end of the configuration process.
*
* @param report - the progress report.
*/
virtual void progressFinished(PConfigurationReport report) = 0;
};
}/* namespace configuration */
}/* namespace whisper */
#include "CCProgressMonitor.hpp"
#import "CCIProgressMonitor.h"
#import "CCConfigurationReport.h"
namespace tsivehicleinterface
{
namespace main
{
using whisper::configuration::PConfigurationReport;
id <CCIProgressMonitor> delegate;
CCProgressMonitor::CCProgressMonitor (void * delegateParam) {
id <CCIProgressMonitor> test = (__bridge id <CCIProgressMonitor>)delegateParam;
if ([test conformsToProtocol:@protocol(CCIProgressMonitor)])
delegate = test;
else
delegate = nil;
}
CCProgressMonitor::~CCProgressMonitor() throw () {
}
void CCProgressMonitor::progressPerformed(int step, int stepCount)
{
[delegate progressPerformedWithStep:step andStepCount:stepCount];
}
void CCProgressMonitor::progressFinished(PConfigurationReport report)
{
int error = report->getError();
const char * reportC = report->getReport();
// This is a promise of the whisper API: The Report will be a zero-terminated string
// We are assuming ASCII encoding at this point
NSString * reportInfo = [NSString stringWithCString:reportC
encoding:NSASCIIStringEncoding];
CCConfigurationReport * configurationReport = [[CCConfigurationReport alloc] initWithErrorNumber:error reportInfo:reportInfo];
[delegate progressFinished:configurationReport];
}
}/* namespace conf */
}/* namespace tsivehicleinterface */
#ifndef __vehicleInterface__CCProgressMonitor__
#define __vehicleInterface__CCProgressMonitor__
#include <stdio.h>
#include <configuration/api/IProgressMonitor.hpp>
#include <configuration/api/IConfigurationReport.hpp>
namespace tsivehicleinterface
{
namespace main
{
using whisper::configuration::IProgressMonitor;
using whisper::configuration::PConfigurationReport;
/**
* Call back monitor for the configuration progress.
*/
class CCProgressMonitor: public IProgressMonitor
{
public:
/**
* Constructor.
*
* @param delegate. Must be of type id<CCIProgressMonitor>, declated void * for compatibility with C++
*/
explicit CCProgressMonitor(void * delegateParam);
/**
* Destructor.
*/
~CCProgressMonitor() throw ();
/**
* @see whisper::configuration::IProgressMonitor#progressPerformed
*/
void progressPerformed(int step, int stepCount);
/**
* @see whisper::configuration::IProgressMonitor#progressFinished
*/
void progressFinished(PConfigurationReport report);
};
}/* namespace conf */
}/* namespace tsivehicleinterface */
#endif /* defined(__vehicleInterface__CCProgressMonitor__) */
00000000000000b6 T tsivehicleinterface::main::CCProgressMonitor::progressFinished(boost::shared_ptr<whisper::configuration::IConfigurationReport>)
0000000000000094 T tsivehicleinterface::main::CCProgressMonitor::progressPerformed(int, int)
000000000000008a T tsivehicleinterface::main::CCProgressMonitor::CCProgressMonitor(void*)
0000000000000000 T tsivehicleinterface::main::CCProgressMonitor::CCProgressMonitor(void*)
0000000000003fd0 S tsivehicleinterface::main::delegate
U vtable for tsivehicleinterface::main::CCProgressMonitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment