summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fd54252)
For class that defines the copy constructor, it is better to add the
assignment operator definition as well.
This commit adds the definition for assignment operator for the classes
with the copy constructor defined.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
public:\r
CIfrOpHeader (IN UINT8 OpCode, IN VOID *StartAddr, IN UINT8 Length = 0);\r
CIfrOpHeader (IN CIfrOpHeader &);\r
public:\r
CIfrOpHeader (IN UINT8 OpCode, IN VOID *StartAddr, IN UINT8 Length = 0);\r
CIfrOpHeader (IN CIfrOpHeader &);\r
+ CIfrOpHeader& operator=(IN CONST CIfrOpHeader &);\r
\r
VOID IncLength (UINT8 Size) {\r
if ((mHeader->Length + Size) > mHeader->Length) {\r
\r
VOID IncLength (UINT8 Size) {\r
if ((mHeader->Length + Size) > mHeader->Length) {\r
mVarTotalSize = Info.mVarTotalSize;\r
}\r
\r
mVarTotalSize = Info.mVarTotalSize;\r
}\r
\r
+EFI_VARSTORE_INFO&\r
+EFI_VARSTORE_INFO::operator= (\r
+ IN CONST EFI_VARSTORE_INFO &Info\r
+ )\r
+{\r
+ if (this != &Info) {\r
+ mVarStoreId = Info.mVarStoreId;\r
+ mInfo.mVarName = Info.mInfo.mVarName;\r
+ mInfo.mVarOffset = Info.mInfo.mVarOffset;\r
+ mVarType = Info.mVarType;\r
+ mVarTotalSize = Info.mVarTotalSize;\r
+ }\r
+\r
+ return *this;\r
+}\r
+\r
BOOLEAN\r
EFI_VARSTORE_INFO::operator == (\r
IN EFI_VARSTORE_INFO *Info\r
BOOLEAN\r
EFI_VARSTORE_INFO::operator == (\r
IN EFI_VARSTORE_INFO *Info\r
\r
EFI_VARSTORE_INFO (VOID);\r
EFI_VARSTORE_INFO (IN EFI_VARSTORE_INFO &);\r
\r
EFI_VARSTORE_INFO (VOID);\r
EFI_VARSTORE_INFO (IN EFI_VARSTORE_INFO &);\r
+ EFI_VARSTORE_INFO& operator=(IN CONST EFI_VARSTORE_INFO &);\r
BOOLEAN operator == (IN EFI_VARSTORE_INFO *);\r
};\r
\r
BOOLEAN operator == (IN EFI_VARSTORE_INFO *);\r
};\r
\r