Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Members are not automatically generated #231

Open
SoggyBottomBoy opened this issue Feb 26, 2023 · 2 comments
Open

Members are not automatically generated #231

SoggyBottomBoy opened this issue Feb 26, 2023 · 2 comments

Comments

@SoggyBottomBoy
Copy link

I have just come across SharpGenTools and am wanting to test it out on an opensource C++ library.

In have following the documentation on how to get started and have the very basics working, however, I can not figure out why no members are being generated. In my Mappings I have the following:

<include file="MyClass.h" namespace="Test.Wrapper" attach="true" />

The header file looks like so:

class  MyClass
{
public:
	 MyClass();
	~ MyClass();
	MyClass Add(MyClass other);

private:

};

the cpp file:

#include "MyClass.h"


MyClass::MyClass()
{
}

MyClass::~MyClass()
{
}

MyClass MyClass::Add(MyClass other)
{
	return MyClass();
}

What is generated is:

namespace Test.Wrapper
{
    /// <summary>
    /// No documentation.
    /// </summary>
    /// <unmanaged>MyClass</unmanaged>
    /// <unmanaged-short>MyClass</unmanaged-short>
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 0, CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
    public partial struct MyClass
    {
    }
}

I'm unsure what I need to do, or what could be causing all members to be excluded.

Any help would be much appreciated.

@ScarletKuro
Copy link

Same thing. I tried to play with SharpGenTools. The structures are generating but the methods are not, even if I define them manually in the Mapping file.

Header
#ifndef _UPT_H_INCLUDED_
#define _UPT_H_INCLUDED_

#ifdef _EXPORTING_DLL_
//code under this ifdef is ment for dll project itself, do not use it if you are importing dll
#define DLLEXPORT   __declspec( dllexport )
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#else
#define DLLIMPORT __declspec( dllimport )
#endif

#define RECEIPT_DATA_SIZE                    200
#define UPT_LOYALTY_TRACK_DATA_SIZE          100
#define UPT_LOYALTY_TAG_DATA_SIZE            500
#define UPT_LOYALTY_AMOUNT_DATA_SIZE         12
#define UPT_LOYALTY_DATA_PROCESSING_TIME     60
#define UPT_LOYALTY_SUPPORTED_TYPES_SIZE     50
#define UPT_INFO_MESSAGE_DATA_SIZE           500
#define UPT_MAX_TERM_CONFIG_DATA_SIZE        4096
#define UPT_MAX_BILL_NR_SIZE                 20

#define LOYSUP_MAG      0x00000001
#define LOYSUP_EEID     0x00000002
#define LOYSUP_AMOD     0x00000004
#define LOYSUP_NFC_UID  0x00000008
#define LOYSUP_NFC_ELVI 0x00000010
#define LOYSUP_COOP     0x00000020

enum T_UPTTransactionTypes
{
 OP_SALE           = 0,
 OP_VOID           = 1,
 OP_REFUND         = 2,
 OP_RESERVATION    = 3,
 OP_PREPAID        = 4,
 OP_RECEIPT_DATA   = 7,
 OP_PRINT_RECEIPT  = 8,//get last or any other receipt by given transaction ID
 OP_BATCH          = 9,
 OP_CASHBACK       = 10,
 OP_RESERV_COMPL   = 13,
 OP_RESERV_VOID    = 14,    //Preauthorization voiding operation
 OP_RESERV_DEL     = 15,    //Preauthorization deletion operation
 OP_CASHOUT        = 25,
 OP_PARTIAL_VOID   = 27,
 OP_CASHIN         = 28,

 //Receipt request operations
 OP_TRANS_REP       = 100,
 OP_JOURNAL_REP     = 101,
 OP_PREAUTH_REP     = 105,
 OP_LAST_COPY       = 106,
 OP_RECEIPT_COPY    = 107,
 OP_LAST_BATCH_COPY = 109,
 OP_SETTING_RECP    = 113,
 OP_HOST_NUM_RECP   = 119,

 //300-399 operation types used to send/download configuration, files or other info 
 OP_UPLOAD_LOG = 300,                      //300 – Send logs to LoadPoint
 OP_UPLOAD_ERROR_REPORT = 301,             //301 – Send error reports to LoadPoint
 OP_DOWNLOAD_LP_PARAMS_FULL = 302,         //Download Full parameters from LoadPoint
 OP_DOWNLOAD_LP_PARAMS_PARTIAL = 303,      //Download Partial parameters from LoadPoint
 OP_DOWNLOAD_HOST_EMV_KEYS = 304,          //Download EMV keys from Host
 OP_DOWNLOAD_HOST_PARAMS = 305,            //Download parameters from Host
 OP_DOWNLOAD_HOST_PARAMS_UPDATE = 306,     //Update parameters from Host
 OP_DOWNLOAD_LP_APP_FULL = 307,            //Download Full application from LoadPoint
 OP_DOWNLOAD_LP_APP_PARTIAL = 308,         //Download Partial application from LoadPoint
 OP_UPLOAD_CONFIG_LP = 309,                //Send configuration files to LoadPoint
 OP_DOWNLOAD_TERM_CERT = 310,              //Download terminal certificate
 OP_RESERVED_FOR_INTERNAL_USE = 311,       //Reserved for internal use
 OP_DOWNLOAD_ALL_PARAMS = 312,             //Download all parameters. Performs full parameter download from LoadPoint and if necessary, downloads EMV keys and parameters from bank host.
 OP_UPLOAD_SYS_LOG = 313,                  //Send syslog to syslog server

 //400-499 operation types used to delete configuration, files or other info
 OP_CLEAR_EMV_KEYS = 400,                  //Delete EMV key from terminal
 OP_CLEAR_HOST_PARAMS = 401,               //Delete parameters downloaded from Host
 OP_CLEAR_CONFIG = 402,                    //Delete terminal configuration
 OP_CLEAR_BATCH = 403,                     //Clear batch
 OP_CLEAR_REVERSALS = 404,                 //Clear reversal list
 OP_CLEAR_PREAUTHORIZATION = 405,          //Delete preauthorization transaction
 OP_CLEAR_ALL_PREAUTHORIZATIONS = 406,     //Delete all preauthorization transactions
 OP_CLEAR_LOG_FILE = 407                   //Clear log file
};

enum T_UPT_Languages
{
 UPT_LANG_LATVIAN     = 0,
 UPT_LANG_RUSSIAN     = 1,
 UPT_LANG_ENGLISH     = 2,
 UPT_LANG_GERMAN      = 3,
 UPT_LANG_LITHUANIAN  = 4,
 UPT_LANG_ESTONIAN    = 5,
 UPT_LANG_DEFAULT     = -1
};

enum T_UPT_Printing_device
{
 UPT_TERMINAL_PRINT   = 0, // terminal print
 UPT_ECR_PRINT        = 1, // ECR print
 UPT_NO_PRINT         = 2,
 UPT_BOTH_PRINT       = 3
};

enum T_UPT_Receipt_data_type
{
 UPT_DESCRIPTION         = 0, // receipt data with description text, format: 'text:receipt_data'
 UPT_RECEIPT_DATA_ONLY   = 1
};

enum T_UPT_Batch_type
{
 UPT_BATCH_TOTALS		= 0,
 UPT_GROUPED_BATCH		= 1,
 UPT_POS_BATCH_RECEIPT	= 99
};

enum T_UPT_Receipt_types
{
 UPT_MERCHANT_AND_CLIENT = 0,
 UPT_ONLY_CLIENT,
 UPT_ONLY_MERCHANT,
 UPT_MERCHANT_AND_CLIENT_WITH_SEP,
 UPT_ONLY_CLIENT_IN_ONE_PACKET,
 UPT_ONLY_MERCHANT_IN_ONE_PACKET,
 UPT_MERCHANT_AND_CLIENT_EACH_IN_ONE_PACKET,
 UPT_MERCHANT_AND_CLIENT_EACH_IN_ONE_PACKET_WITH_SEP,
 UPT_MERCHANT_AND_CLIENT_WITH_SEP_AS_DATA_PACKET,
 UPT_MERCHANT_AND_CLIENT_WITH_SEP_EACH_IN_ONE_PACKET
};

enum T_UPT_Print_Data_Formatting_type
{
 UPT_DEFAULT = 0,
 UPT_DO_NOT_USE_FORMATTING,
 UPT_USE_FORMATTING,
 UPT_DO_NOT_USE_FORMATTING_AND_ALL_PRINT_LINES_40,
 UPT_DO_NOT_USE_FORMATTING_AND_ALL_PRINT_LINES_42,
 UPT_DO_NOT_USE_FORMATTING_AND_ALL_PRINT_LINES_24
};

enum T_UPT_Data_Encoding
{
 UPT_DE_UNDEFINED           = 0,
 UPT_DE_ISO_8859_13         = 1, //actual LIB<->POS protocol value '0'
 UPT_DE_BALTIC_WINDOWS_1257 = 2  //actual LIB<->POS protocol value '1'
};

struct T_UptTransactionRequest
{
 T_UPTTransactionTypes TransactionType;
#ifdef TEST_IS_VATS
 long Amount;
#else
 unsigned long Amount;                     //Transaction amount in cents
#endif
 T_UPT_Languages TransactionLanguage;      //Language of the current transaction
 T_UPT_Printing_device PrintingDevice;
 T_UPT_Batch_type BatchDataType;           //BatchType;
 T_UPT_Receipt_data_type ReceiptDataType;  //ReceiptDataType;
 unsigned short Currency;
 unsigned short PrePaidCode;
 char HostID[20];
 char cbTransactionID[RECEIPT_DATA_SIZE];
 T_UPT_Receipt_types ReceiptType;
 bool UserInputSupported;//deprecated, use SetUserInputSupport(..) function
 T_UPT_Print_Data_Formatting_type PrintDataFormattingType;
 char cPreauthorizationID[RECEIPT_DATA_SIZE];
 char szBillNr[UPT_MAX_BILL_NR_SIZE + 1];
};

enum T_UptTransactionReturn
{
 UPT_TRANSACTION_AUTHORIZED = 0,
 UPT_TRANSACTION_CANCELED,
 UPT_TRANSACTION_INVALID_AMOUNT,
 UPT_TRANSACTION_INVALID_TRX_TYPE,
 UPT_TRANSACTION_PROCESSING_ERROR,
 UPT_TRANSACTION_AUTHORIZATION_ERROR
};

enum T_UptTerminalState
{
 UPT_READY_FOR_WORK             = 0,
 UPT_BUSY                       = 1,
 UPT_OUT_OF_PAPER               = 2,
 UPT_PINPAD_NOT_WORK            = 3,
 UPT_MODEM_OFF                  = 4,
 UPT_TRAN_FILE_FULL             = 5,
 UPT_PARAM_ABSENT               = 6,
 UPT_FORGOTTEN_CARD             = 7,
 UPT_NOT_RESPONSE_FROM_TERMINAL = 88,
 UPT_UNKNOWN_ERROR              = 99 //processing error 
};

enum T_UptConnectionState
{
 UPT_CONN_SUCCESSFUL = 0,
 UPT_CONN_FAIL
};

enum T_UptCardState
{
 UPT_CARD_UNDEFINED = -1,
 UPT_CARD_PRESENT = 1,
 UPT_CARD_ABSENT = 0
};

struct T_UptState
{
 T_UptTerminalState UPT_State;
 T_UptConnectionState UPT_ConnState;
 char cbTerminalID[ 15 ];
 char cbAppVersion[ 40 ];
 char cbProtocolVersion[ 20 ];// ECR to terminal data exchange protocol version
 char cbTerminalSN[ 20 ];
 char cbMerchantID[ 20 ];
 T_UptCardState UPT_CardState;
};

enum T_Upt_FunctionTypes
{
 UPT_DOWNL_ALL = 1,         //1  - download all parameters(from 2 till 6)
 UPT_DOWNL_LP_PARAMS,       //2  - download parameters from LoadPoint
 UPT_DOWNL_HOST_PARAMS,     //3  - download parameters from host
 UPT_DOWNL_EMV_KEYS,        //4  - download EMV keys
 UPT_DOWNL_STOP_LIST,       //5  - download stop list
 UPT_DOWNL_APP_OS,          //6  - download application and os 
 UPT_DOWNL_APP,             //7  - download application 
 UPT_DOWNL_OS,              //8  - download os
 UPT_UPLOAD_FILES_TO_LP,    //9  - upload files to LoadPoint
 UPT_TEST_TR=10,            //10 - make a test transaction
 UPT_CLEAR_TRANS_DATA=15    //15 - clear transaction data
};

enum T_Upt_ClearTypes
{
 UPT_CLEAR_ALL=1,  //0 - clear all
 UPT_CLEAR_BATCH,  //1 - clear batch
 UPT_CLEAR_REV     //2 - clear reversals
};

struct T_UptFunctionRequest
{
 T_Upt_FunctionTypes FunctionType;
 int iHostID;
 T_Upt_ClearTypes ClearType;
};


struct T_UptReceipt
{
 char cbCardName[RECEIPT_DATA_SIZE];             // card name(VISA, VISA Electron, Maestro, etc.)
 char cbCardNumber[RECEIPT_DATA_SIZE];           // masked card number
 char cbValidDate[RECEIPT_DATA_SIZE];            // valid date of card
 char cbTicketNumber[RECEIPT_DATA_SIZE];         // receipt number from UPT
 char cbAuthCode[RECEIPT_DATA_SIZE];             // authorization identification response code from host
 char cbRefNumber[RECEIPT_DATA_SIZE];            // retrieval reference number
 char cbTerminalID[RECEIPT_DATA_SIZE];           // terminal ID issued by bank
 char cbTVR[RECEIPT_DATA_SIZE];                  // terminal verification result
 char cbTSI[RECEIPT_DATA_SIZE];                  // transaction status information
 char cbAPI[RECEIPT_DATA_SIZE];                  // application priority indicator
 char cbResponseCode[RECEIPT_DATA_SIZE];         // action code from host
 char cbAData[RECEIPT_DATA_SIZE];                // authentication data - TC, AC, AAC
 char cbAID[RECEIPT_DATA_SIZE];
 char cbAppLabel[RECEIPT_DATA_SIZE];
 char cbTransactionDate[RECEIPT_DATA_SIZE];
 char cbMerchantID[RECEIPT_DATA_SIZE];
 char cbProcessingCode[RECEIPT_DATA_SIZE];
 char cbPOSEntryMode[RECEIPT_DATA_SIZE];
 char cbCHVM[RECEIPT_DATA_SIZE];//Card Holder Verification Method
 char cbBatchNumber[RECEIPT_DATA_SIZE];
 char cbLoylatyCardData[RECEIPT_DATA_SIZE];
 char cbTerminalSN[RECEIPT_DATA_SIZE];//terminal Serial Number
 char cbRespTransactionAmount[RECEIPT_DATA_SIZE];
 char cbRespCurrencyCode[RECEIPT_DATA_SIZE];
 char cbTransactionType[RECEIPT_DATA_SIZE]; // info name of transaction type(for receipt)
 char cbEMVLangTag[RECEIPT_DATA_SIZE];
 char cbCardEntryType[RECEIPT_DATA_SIZE];
 char cbCTLSCardType[RECEIPT_DATA_SIZE];
 char cbCTLSOfflineAmount[RECEIPT_DATA_SIZE];
 char cbTag9C[RECEIPT_DATA_SIZE];
 char cbTag5F34[RECEIPT_DATA_SIZE];
 char cbTag9F03[RECEIPT_DATA_SIZE];
 char cbTag9F10[RECEIPT_DATA_SIZE];
 char cbTag9F1A[RECEIPT_DATA_SIZE];
 char cbTag9F27[RECEIPT_DATA_SIZE];
 char cbTag9F34[RECEIPT_DATA_SIZE];
 char cbTag9F36[RECEIPT_DATA_SIZE];
 char cbTag9F37[RECEIPT_DATA_SIZE];
 char cbTACDefault[RECEIPT_DATA_SIZE];
 char cbTACDenial[RECEIPT_DATA_SIZE];
 char cbTACOnline[RECEIPT_DATA_SIZE];
 char cbIACDefault[RECEIPT_DATA_SIZE];
 char cbIACDenial[RECEIPT_DATA_SIZE];
 char cbIACOnline[RECEIPT_DATA_SIZE];
 char cbMerchantName[RECEIPT_DATA_SIZE];
 char cbSTAN[RECEIPT_DATA_SIZE];
 char cbTransIndicator[RECEIPT_DATA_SIZE];
 char cbMerchantAddress[RECEIPT_DATA_SIZE];
 char cbMerchantRegNr[RECEIPT_DATA_SIZE];
 char cbMerchantCashNr[RECEIPT_DATA_SIZE];
 char cbAltCurrName[RECEIPT_DATA_SIZE];
 char cbAltCurrAmount[RECEIPT_DATA_SIZE];
 char cbMerchTicketCardNumber[RECEIPT_DATA_SIZE];
 char cbAcquirerID[RECEIPT_DATA_SIZE];
 char cbPrePaidName[100];
 char cbPrePaidNominal[50];
 char cbPrePaidDuration[50];
 char cbPrePaidExtDuration[50];
 char cbPrePaidExpirity[50];
 char cbPrePaidValue[50];
 char cbPrePaidSerial[50];
 char cbPrePaidDescription[2000];
 char cbTransactionID[RECEIPT_DATA_SIZE];
 char cPANFirst6Digits[RECEIPT_DATA_SIZE];
 char cPANLast4Digits[RECEIPT_DATA_SIZE];
 char cPANLen[RECEIPT_DATA_SIZE];
 char cPreauthorizationID[RECEIPT_DATA_SIZE];
 char szBillNr[UPT_MAX_BILL_NR_SIZE + 1];
};

struct T_UptTransactionReport
{
 char cbTrxStatusDisplyMsg[100];
 T_UptTransactionReturn UPT_Transaction_return;
 T_UptReceipt Receipt;
 char cbTrxStatusCode[3+1];
};

struct T_HostListData
{
 char cbHostID[5];
 char cbHostName[20];
};

struct T_HostTotalData
{
 char cbCurrency[5];
 char cbDebitCount[20];
 char cbDebitTotal[20];
 char cbCreditCount[20];
 char cbCreditTotal[20];
};

struct T_InfoMessage
{
 char cMessage[ UPT_INFO_MESSAGE_DATA_SIZE ];
 int  iMessageTimeout;
};

struct T_LoyaltyRequest
{
 char cSupportedTypes[ UPT_LOYALTY_SUPPORTED_TYPES_SIZE ]; //supported loyalty card list (e.x.: "LHV;EEID;COOP;NFC_ELVI;....")
 bool bUseResultMessage;
};

struct T_LoyaltyCardData
{
 char cbLoyaltyData1[ UPT_LOYALTY_TRACK_DATA_SIZE ];
 char cbLoyaltyData2[ UPT_LOYALTY_TRACK_DATA_SIZE ];
 char cbLoyaltyDataTags[ UPT_LOYALTY_TAG_DATA_SIZE ];//starting with with interface version UPT_IF_VER_2_2_6_2
 int  iProcessingTimeout;//starting with with interface version UPT_IF_VER_2_3_9_0
};

struct T_LoayltyResponse
{
 char cUpdatedAmount[ UPT_LOYALTY_AMOUNT_DATA_SIZE + 1 ];
 int  iProceedWithAuthorization;
 T_InfoMessage st_InfoMessage;
};

typedef struct
{
 char szConfigData[ UPT_MAX_TERM_CONFIG_DATA_SIZE + 1];
}
stTerminalConfig;

enum T_UPTComPortSpeed
{
 UPT_COM_SPEEED_DEFAULT = 0,
 UPT_COM_SPEEED_1200,
 UPT_COM_SPEEED_2400,
 UPT_COM_SPEEED_4800,
 UPT_COM_SPEEED_9600,
 UPT_COM_SPEEED_14400,
 UPT_COM_SPEEED_19200,
 UPT_COM_SPEEED_38400,
 UPT_COM_SPEEED_57600,
 UPT_COM_SPEEED_115200
};

enum T_UPTLoyReadStatus
{
 UPT_LOY_READ_OK              = 0,    //"Operation processed successfully",
 UPT_LOY_READ_INFO_TYPE_ERROR = 1,    //"Unknown or missing information type",
 UPT_LOY_READ_NOT_ALLOWED     = 2,    //"Loyalty card data read not allowed",
 UPT_LOY_READ_ERROR           = 3,    //"Data read error",
 UPT_LOY_READ_NO_CARD_READER  = 4,    //"Card reader absent or defective",
 UPT_LOY_READ_UNKNOWN_CARD    = 5,    //"Unknown card",
 UPT_LOY_READ_TIMEOUT         = 6,    //"Card read timeout",
 UPT_LOY_READ_CANCELED        = 7,    //"Operation canceled",
 UPT_LOY_READ_SYS_ERROR       = 99    //"System error",
};

enum T_UPT_InterfaceVersion
{
 UPT_IF_VER_UNDEFINED = 0,
 UPT_IF_VER_2_2_6_2,
 UPT_IF_VER_2_2_8_0,
 UPT_IF_VER_2_3_7_0,
 UPT_IF_VER_2_3_9_0,
 UPT_IF_VER_2_4_3_0
};

enum T_UPT_InputType
{
 UPT_PERSONAL_IDENTIFICATION_CODE = 0,
 UPT_COMPANY_CODE,
 UPT_COUPON_CODE,
 UPT_CARD_CODE
};

enum T_UPTEcrMode
{
 UPT_ECR_MODE_DEFAULT = 0,
 UPT_ECR_MODE_WIRELESS_RESTAURANT
};

#define LOG_LEVEL_OFF      '0'
#define LOG_LEVEL_TRIMMED  '1'
#define LOG_LEVEL_FULL     'F'

//order options
#define SUPPORT_ORDER_DETAILS 0x01

enum T_UPT_NotificationType
{
 ST_IDLE,                // 0 - terminal is in idle state
 ST_INSERT_CARD,         // 1 - terminal is waiting for card
 ST_PLEASE_WAIT,         // 2 - common state when terminal is performing some action
 ST_SELECT_LANGUAGE,     // 3 - terminal is waiting for cardholder to select language
 ST_SELECT_APPLICATION,  // 4 - terminal is waiting for cardholder to select application
 ST_ENTER_PIN,           // 5 - terminal is waiting for cardholder to input pin code
 ST_PIN_ENTERED,         // 6 - pin code entry completed
 ST_AUTHORIZATION,       // 7 - authorization is being performed
 ST_REMOVE_CARD,         // 8 - terminal is waiting for cardholder to input pin code
 ST_WRONG_PIN,           // 9 - wrong pin was entered
 ST_LAST_PIN_ENTRY,      //10 - cardholder has only one last pin entry attempt
 ST_PIN_TRY_LT_EXCEEDED, //11 - no more pin tries left
 ST_DOWNLOAD_INFO,       //12 - application/parameter download info
 ST_PRESENT_CARD,        //13 - terminal is waiting for card
 ST_ENTER_CASHBACK_PIN   //14 - terminal is waiting for cardholder to input pin code for cashback transaction
};

#ifdef _EXPORTING_DLL_
class DLLEXPORT T_Upt
#else
class DLLIMPORT T_Upt
#endif
{
public:
 T_Upt();
 virtual ~T_Upt();
 char Receipt[5000];

 bool EncashTransaction();
 bool TransactionRequest( T_UptTransactionRequest*, T_UptTransactionReport* );
 bool GetState( T_UptState* );
 bool Cancel();
 bool WaitForCardRemoving();

 bool GetHostList( T_HostListData* );
 bool GetNextHostList( T_HostListData* );
 bool GetHostTotal( int, T_HostTotalData* );
 bool GetLoyaltyCardData( char*, T_LoyaltyCardData* );   //deprecated, use ReadLoyaltyCardData(..)
 bool ReadLoyaltyCardData( T_LoyaltyRequest*, T_LoyaltyCardData* );

 bool TerminalFunction( T_UptFunctionRequest*, char* );
 bool GetTrxReceiptData( T_UptTransactionRequest*, T_UptTransactionReport* );   //deprecated, use TransactionRequest(..) with trans type OP_RECEIPT_DATA.
 void vcb_GetInfoText( int*, char* );   //deprecated, use SetNotificationCallback(..) instead

 bool SetLast4DigitsCallback(         int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetYesNoSelectionCallback(      int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetAuthCodeCallback(            int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetDailyPwdCallback(            int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetMerchantPwdCallback(         int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetReceiptNrCallback(           int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader, const char* pcDefaultText ) );
 bool SetSaleAmountCallback(          int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetDateCallback(                int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetTimeCallback(                int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetCheckCardSecurityCallback(   int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool SetNotificationCallback(       void( *pFunction )( int iNotificationType, char* pcNotificationText ) );
 bool SetProcessLoyaltyDataCallback(  int( *pFunction )( char* pcNewAmount, const char* cLoyaltyCardData, int iTimeoutSec ) );//deprecated, use bSetLoyaltyCallback
 bool SetSTANCallback(                int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool bSetPreauthorizationIDCallback( int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );
 bool bSetSelectMenuItemCallback(     int( *pFunction )( int*  piSelectedIndex, int iItemCount, int iTimeoutSec, const char* pcItemList, const char* pcFormHeader ) );
 bool bSetCardInsertionCallback(     void( *pFunction )( const char* pcTransactionID, const char* pcAdditionalData ) );
 bool SetPartialVoidAmountCallback(   int( *pFunction )( char* pcResult, int iBufferLen, int iTimeoutSec, int iMinDataSize, int iMaxDataSize, const char* pcFormHeader ) );

 bool SetComPortNumber( int );
 bool SetComPortSpeed( T_UPTComPortSpeed );
 bool SetCommForwarding( bool );
 bool SetLoyaltySupport( unsigned long );
 bool SetUserInputSupport( bool );

 bool bSetDataEncoding( T_UPT_Data_Encoding );
 bool bSetSkipCardRemoval( bool );
 bool bSetSkipReceiptMerchantData( bool );

 bool bSetInterfaceVersion( T_UPT_InterfaceVersion );
 bool bDeclineTransaction( void );

 bool bPerformDataInput( T_UPT_InputType enCodeType, T_UPT_Languages enInputLanguage, char* pcEncryptionKeyData, int iEncryptionKeyDataSize, int iTimeout, bool bUseMaskedInput, int iMinDataSize, int iMaxDataSize, int* piStatus, char* pcOutputData, int* iOutputDataSize );
 bool bSetSkipConnectionTest( bool );
 bool bSetEcrMode( T_UPTEcrMode eMode );
 bool bSetListeningPort( unsigned int uiPort );

 //Restaurant functionality callbacks
 bool bSetGetOrderListCallback(       int( *pFunction )( char* pcWaiterId, int* piOptions, int* piOutOrderCount, char* pcOutOrderList, size_t uiMaxOrderListSize ) );
 bool bSetGetOrderDetailsCallback(    int( *pFunction )( char* pcOrderId, int iOptions, char* pcOutBuff, size_t uiBuffSize ) );
 bool bSetOperationRequestCallback(   int( *pFunction )( char* pcOrderId, int iOptions, T_UptTransactionRequest* pTransData ) );
 bool bSetOperationResultCallback(    int( *pFunction )( T_UptTransactionReport* pResult ) );
 bool bSetReceiptAvailableCallback(   int( *pFunction )( char* pcReceipt, char* pcTransactionID ) );

 bool bSetNotificationFormCallback(   int( *pFunction )( const char* pcFormHeader, int iTimeoutSec ) );

 void vSetLogLevel( char cLogLevel );
 void vSetECRSoftwareNameVersion( char* pcECRSoftwareNameVersion );
 void vSetIsCardStateCheckEnabled(bool bIsEnabled);
 bool SetProcessLoyaltyDataWithAuthDecisionCallback(  int( *pFunction )( char* pcNewAmount, const char* cLoyaltyCardData, int iTimeoutSec, int* piProceedWithAuthorization ) );//deprecated, use bSetLoyaltyCallback
 bool bSetLoyaltyCallback( int( *pFunction )( T_LoyaltyCardData* pst_PosLoyData, T_LoayltyResponse* pst_EcrResponse ) );

 bool bShowInfoMessage( T_InfoMessage* pst_InfoMessage );
 bool bGetTerminalConfig( stTerminalConfig* pstTerminalConfig );
};

#endif

@MikhailGorobets
Copy link

@ScarletKuro
You need to use pure virtual methods. This framework uses the offset from the vtable to call functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants