2011-12-21 19 views
2

私は3つのファイルを最初に持っていますが、bmptktevent.hは2つ目はbmptktevent.cで、3つ目はsbsngenerator.pCファイルです。 IPAddr属性を1つ追加する必要があります。そして私は、これらの3つのファイルのipaddrを追加したが、私はこれをコンパイルしていたときにはエラー引数の不一致エラーがC++コード

SbsnEvtGenerator.C", line 2107: Error: Could not find a match for BMPTktClearanceEvt::BMPTktClearanceEvt(const cpInstanceId, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, cpAttrClone, const cpAttribute, const cpAttribute, const cpAttribute, const cpAttribute, cpAttribute, cpAttribute, cpAttribute, cpAttribute, cpAttribute*, cpAttribute*, cpAttribute*, cpAttribute*, cpAttribute*, cpAttribute)

私は3つのファイルを添付していますを与えています。親切に私がこの問題を出す助けてください。 私はこれら3つのファイルを変更しました。最初のものは、第六の第二持続する方法

SbsnEvtGenerator.pC 
cpAttribute *IPAddr = _grabAttr(extraAttrs, BMPMO_IPAddress); 

case IPAddressChangeEvt : 
     { 
      supTDO << setdl(TKT_TR_INFO) << "Trying to " 
      << "create a IPAddressChangeEvt object..." 
      << endsup; 

      FailIfAttrIsNull(IPAddr, BMPMO_IPAddress); 

      tktEvt = new BMPTktIPAddressChangeEvt(
        // S.Liou 01/13/98 : bmp980015.04 
        // trblTktId, acMCN, acTktSrc, 
        trblTktId, acMCN, 
        acCGWSbsnValue, acserviceCode, 
        actier1, actier2, actos, acbesban, 
        accustIdType, accustIdValue,acIPCustId,acDomainName, //EM_LOCAL_2 
        acserviceIdType,accustTicketNumber,acbridgeSysTktId, 
        acTktSrc, //bmp021267.08 
        // End of bmp980015.04 [S.Liou] 
        *atLoginId, *atWkCtrId, 
        //Sameer...bmp983284.11 
              attrAutoIndicator, 
        *IPAddr); 

bmptkt event.hで

class BMPTktIPAddressChangeEvt: public BMPTktEvent 
{ 
public: 
BMPTktIPAddressChangeEvt() 
    {type=IPAddressChangeEvt;} 
BMPTktIPAddressChangeEvt(const cpInstanceId& tktId, 
    const cpAttribute& MCN, 
    const cpAttribute& cgwSbsn, //bmp980015 
    const cpAttribute& serviceCode, // bmp011771 
    const cpAttribute& tier1, // bmp011771.05 
    const cpAttribute& tier2, // bmp011771.05 
    const cpAttribute& typeOfService, //ASV R23.0 //bmp020785.06 
    const cpAttribute& BESBAN, // R24.0 EM Local #bmp021233.23 
    const cpAttribute& CustIdType, //EM_LOCAL_2 
    const cpAttribute& CustIdValue, //EM_LOCAL_2 
    const cpAttribute& IPCustId, 
      const cpAttribute& DomainName, 
    const cpAttribute& serviceIdType, //IP Cable #bmp021267 R24.0 
    const cpAttribute &custTicketNumber, 
    const cpAttribute &bridgeSysTktId, 
    const cpAttribute& srcSys, const cpAttribute& loginId, 
    const cpAttribute& workCenter, 
    const cpAttribute& autoInd, //Sameer...bmp983284.14 
    const cpAttribute& IPAddr) ; 
}; 

とbmptktevent.C

+10

これは実際には32個のパラメータを持つコンストラクタですか?ワオ。 –

+7

うわー。この署名のみがTDWTFに送付されるべきである。 – kennytm

+5

No.いいえ。この現実を拒絶し、コードをリファクタリングすることによってあなた自身のものに置き換えます。コンストラクタは、これらのさまざまなパラメータの論理的なグループを組み合わせた何らかの集計を取っています。この種のコードは、あなたが発見しただけでは維持できません。 –

答えて

3

Error: Could not find a match for BMPTktClearanceEvt::BMPTktClearanceEvt([...] cpAttribute, cpAttribute*, cpAttribute*, cpAttribute*, cpAttribute*, cpAttribute*, cpAttribute)

に注意がポインタであるています。あなたは十分に参照外ではありません:

// these are the last 6 parameters you're passing: 
acbridgeSysTktId, 
acTktSrc, //bmp021267.08 
// End of bmp980015.04 [S.Liou] 
*atLoginId, *atWkCtrId, 
//Sameer...bmp983284.11 
attrAutoIndicator, 
*IPAddr 

いずれかがダブルポインタであるかどうかを確認してください。また、実際に渡す最初のいくつかのパラメータはcpAttrCloneです。それらは暗黙的にcpAttributeに変換可能ですか?そうでない場合、それもエラーの原因です。

+9

それは、*コードを燃やして、何かにリファクタリングしてください。 – Xeo