[commit] r1337 - trunk/GME/ConstraintManager
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Wed Jun 1 16:35:48 CDT 2011
Author: ksmyth
Date: Wed Jun 1 16:35:47 2011
New Revision: 1337
Log:
Some UNICODE. Use C++0x regex. Use unique_ptr.
Deleted:
trunk/GME/ConstraintManager/Regexp.cpp
trunk/GME/ConstraintManager/Regexp.h
Modified:
trunk/GME/ConstraintManager/ (props changed)
trunk/GME/ConstraintManager/ConstraintManager.vcxproj
trunk/GME/ConstraintManager/ConstraintManager.vcxproj.filters
trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp
trunk/GME/ConstraintManager/GMEConstraintEx.cpp
trunk/GME/ConstraintManager/GMEConstraintPropertiesDialog.cpp
trunk/GME/ConstraintManager/GMEConstraintTreeCtrl.cpp
trunk/GME/ConstraintManager/GMESmallMessageBox.cpp
trunk/GME/ConstraintManager/GMESyntacticSemanticDialog.cpp
trunk/GME/ConstraintManager/GMEViolationDialog.cpp
trunk/GME/ConstraintManager/OCLCommonEx.cpp
trunk/GME/ConstraintManager/OCLFactory.h
trunk/GME/ConstraintManager/OCLGMECMFacade.cpp
trunk/GME/ConstraintManager/OCLGMEECFacade.cpp
trunk/GME/ConstraintManager/OCLObjectExBasic.cpp
trunk/GME/ConstraintManager/OCLObjectExBasic.h
trunk/GME/ConstraintManager/OCLObjectExGME.cpp
trunk/GME/ConstraintManager/OCLTree.cpp
trunk/GME/ConstraintManager/OCLTree.h
trunk/GME/ConstraintManager/OCLType.cpp
trunk/GME/ConstraintManager/OCLType.h
trunk/GME/ConstraintManager/OCLTypeExBasic.cpp
trunk/GME/ConstraintManager/OCLTypeExBasic.h
trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp
trunk/GME/ConstraintManager/OCLTypeExGMECM.h
trunk/GME/ConstraintManager/OCLTypeExGMEEC.cpp
trunk/GME/ConstraintManager/OCLTypeExGMEEC.h
trunk/GME/ConstraintManager/OclConstraint.cpp
trunk/GME/ConstraintManager/Solve4786.h
trunk/GME/ConstraintManager/StdAfx.h
trunk/GME/ConstraintManager/TokenEx.cpp
Modified: trunk/GME/ConstraintManager/ConstraintManager.vcxproj
==============================================================================
--- trunk/GME/ConstraintManager/ConstraintManager.vcxproj Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/ConstraintManager.vcxproj Wed Jun 1 16:35:47 2011 (r1337)
@@ -23,13 +23,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -174,7 +174,6 @@
<ClCompile Include="OCLTypeExBasic.cpp" />
<ClCompile Include="OCLTypeExGMECM.cpp" />
<ClCompile Include="OCLTypeExGMEEC.cpp" />
- <ClCompile Include="Regexp.cpp" />
<ClCompile Include="StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@@ -269,7 +268,6 @@
<ClInclude Include="OCLTypeExGMECM.h" />
<ClInclude Include="OCLTypeExGMEEC.h" />
<ClInclude Include="OclViolation.h" />
- <ClInclude Include="Regexp.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="Solve4786.h" />
<ClInclude Include="StdAfx.h" />
Modified: trunk/GME/ConstraintManager/ConstraintManager.vcxproj.filters
==============================================================================
--- trunk/GME/ConstraintManager/ConstraintManager.vcxproj.filters Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/ConstraintManager.vcxproj.filters Wed Jun 1 16:35:47 2011 (r1337)
@@ -132,9 +132,6 @@
<ClCompile Include="OCLTypeExGMEEC.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="Regexp.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="StdAfx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -308,9 +305,6 @@
<ClInclude Include="OclViolation.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="Regexp.h">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="Resource.h">
<Filter>Header Files</Filter>
</ClInclude>
Modified: trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -472,8 +472,7 @@
else {
CString strCount;
m_pageSettings.m_edtViolationCount.GetWindowText( strCount );
- info.iViolationCount = atoi( strCount.GetBuffer( strCount.GetLength() ) );
- strCount.ReleaseBuffer();
+ info.iViolationCount = _ttoi( strCount );
}
if ( ( (CButton*) m_pageSettings.GetDlgItem( BSEP_RDZERODEPTH ) )->GetCheck() == 1 )
@@ -498,11 +497,11 @@
( (CButton*) m_pageSettings.GetDlgItem( BSEP_RDVIOLCOUNT ) )->SetCheck( 1 );
m_pageSettings.m_edtViolationCount.SetReadOnly( false );
CString strCount;
- strCount.Format( "%d", info.iViolationCount );
+ strCount.Format( _T("%d"), info.iViolationCount );
m_pageSettings.m_edtViolationCount.SetWindowText( strCount );
}
else {
- m_pageSettings.m_edtViolationCount.SetWindowText( "2" );
+ m_pageSettings.m_edtViolationCount.SetWindowText( _T("2") );
switch( info.iViolationCount ) {
case 1 : ( (CButton*) m_pageSettings.GetDlgItem( BSEP_RDVIOLFIRST ) )->SetCheck( 1 ); break;
case -1 : ( (CButton*) m_pageSettings.GetDlgItem( BSEP_RDLEVELFIRST ) )->SetCheck( 1 ); break;
@@ -1069,14 +1068,13 @@
CString strCount;
m_edtViolationCount.GetWindowText( strCount );
if ( strCount.IsEmpty() )
- m_edtViolationCount.SetWindowText( "2" );
+ m_edtViolationCount.SetWindowText( _T("2") );
else {
- int iCount = atoi( strCount.GetBuffer( strCount.GetLength() ) );
- strCount.ReleaseBuffer();
+ int iCount = _ttoi( strCount );
if ( iCount == 0 )
- m_edtViolationCount.SetWindowText( "2" );
+ m_edtViolationCount.SetWindowText( _T("2") );
if ( iCount > 999 )
- m_edtViolationCount.SetWindowText( "999" );
+ m_edtViolationCount.SetWindowText( _T("999") );
}
}
Modified: trunk/GME/ConstraintManager/GMEConstraintEx.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMEConstraintEx.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/GMEConstraintEx.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -166,13 +166,12 @@
COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( "Priority" ), &spNode ) );
COMTHROW( spNode->get_Value( PutOut( strTemp ) ) );
- m_lPriority = atol( strTemp.GetBuffer( strTemp.GetLength() ) );
+ m_lPriority = _ttol( strTemp );
if ( ! vecLibPath.empty() )
SetType( ( m_lPriority == 1 ) ? CT_CRITICAL_LIBRARY : CT_NON_CRITICAL_LIBRARY, vecLibPath );
else
SetType( ( m_lPriority == 1 ) ? CT_CRITICAL_USER : CT_NON_CRITICAL_USER );
- strTemp.ReleaseBuffer();
strTemp.Empty();
spNode = NULL;
@@ -200,10 +199,9 @@
COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( "EventMask" ), &spNode ) );
COMTHROW( spNode->get_Value( PutOut( strTemp ) ) );
- char* pchStop;
- m_ulEventMask = strtoul( strTemp.GetBuffer( strTemp.GetLength() ), &pchStop, 10 );
+ TCHAR* pchStop;
+ m_ulEventMask = _tcstoul( strTemp, &pchStop, 10 );
- strTemp.ReleaseBuffer();
strTemp.Empty();
spNode = NULL;
@@ -263,18 +261,18 @@
CComPtr<IMgaRegNode> spNode;
CString strTemp;
- COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( "EventMask" ), &spNode ) );
- strTemp.Format( "%d", m_ulEventMask );
+ COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( L"EventMask" ), &spNode ) );
+ strTemp.Format( _T("%d"), m_ulEventMask );
COMTHROW( spNode->put_Value( CComBSTR( strTemp ) ) );
strTemp.Empty();
spNode = NULL;
- COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( "Description" ), &spNode ) );
+ COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( L"Description" ), &spNode ) );
COMTHROW( spNode->put_Value( CComBSTR( OclCommonEx::Convert( m_strMessage ) ) ) );
spNode = NULL;
- COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( "Priority" ), &spNode ) );
- strTemp.Format( "%d", m_lPriority );
+ COMTHROW( spRegNode->get_SubNodeByName( CComBSTR( L"Priority" ), &spNode ) );
+ strTemp.Format( _T("%d"), m_lPriority );
COMTHROW( spNode->put_Value( CComBSTR( strTemp ) ) );
strTemp.Empty();
spNode = NULL;
@@ -382,7 +380,7 @@
: ConstraintBase()
{
CString strTemp = OclCommonEx::Convert( strParameterList );
- strTemp.Replace( ",", ";" );
+ strTemp.Replace( _T(","), _T(";") );
m_strParameterList = OclCommonEx::Convert( strTemp );
Trim( m_strParameterList );
@@ -401,19 +399,19 @@
m_spFCO = spFCO;
CString strParameterList;
- COMTHROW( spFCO->get_StrAttrByName( CComBSTR( "CFuncParamList" ), PutOut( strParameterList ) ) );
- strParameterList.Replace( ",", ";" );
+ COMTHROW( spFCO->get_StrAttrByName( CComBSTR( L"CFuncParamList" ), PutOut( strParameterList ) ) );
+ strParameterList.Replace( _T(","), _T(";") );
m_strParameterList = OclCommonEx::Convert( strParameterList );
Trim( m_strParameterList );
CString strExpression;
- COMTHROW( spFCO->get_StrAttrByName( CComBSTR( "CFuncDefinition" ), PutOut( strExpression ) ) );
+ COMTHROW( spFCO->get_StrAttrByName( CComBSTR( L"CFuncDefinition" ), PutOut( strExpression ) ) );
m_strExpression = OclCommonEx::Convert( strExpression );
Trim( m_strExpression );
CString strAttrStereotype;
- COMTHROW( spFCO->get_StrAttrByName( CComBSTR( "CFuncStereotype" ), PutOut( strAttrStereotype ) ) );
- SetType( ( strAttrStereotype == "attribute" ) ? ConstraintBase::CT_ATTRIBUTE_META : ConstraintBase::CT_METHOD_META );
+ COMTHROW( spFCO->get_StrAttrByName( CComBSTR( L"CFuncStereotype" ), PutOut( strAttrStereotype ) ) );
+ SetType( ( strAttrStereotype == _T("attribute") ) ? ConstraintBase::CT_ATTRIBUTE_META : ConstraintBase::CT_METHOD_META );
std::string strStereotype = " def" + OclCommonEx::Convert( strAttrStereotype ) + " ";
std::string strName = OclCommonEx::GetObjectName( spFCO.p );
@@ -459,18 +457,18 @@
strFunctionData = strFunctionData.Right( strFunctionData.GetLength() - 8 );
strFunctionData.TrimLeft();
- int iPos = strFunctionData.Find( "(" );
+ int iPos = strFunctionData.Find( _T("(") );
if ( iPos != -1 ) {
strTemp = strFunctionData.Left( iPos );
strTemp.TrimLeft(); strTemp.TrimRight();
strName = OclCommonEx::Convert( strTemp );
strFunctionData = strFunctionData.Right( strFunctionData.GetLength() - iPos - 1 );
- iPos = strFunctionData.Find( ")" );
+ iPos = strFunctionData.Find( _T(")") );
if ( iPos != -1 ) {
strTemp = strFunctionData.Left( iPos );
strTemp.TrimLeft(); strTemp.TrimRight();
- strTemp.Replace( ",", ";" );
+ strTemp.Replace( _T(","), _T(";") );
m_strParameterList = OclCommonEx::Convert( strTemp );
strFunctionData = strFunctionData.Right( strFunctionData.GetLength() - iPos - 1 );
@@ -517,11 +515,11 @@
strFunctionData = strFunctionData.Right( strFunctionData.GetLength() - iPos - 1 );
}
- iPos = strFunctionData.Find( ';' );
+ iPos = strFunctionData.Find( _T(';') );
if ( iPos != -1 ) {
strTemp = strFunctionData.Left( iPos );
strTemp.TrimLeft(); strTemp.TrimRight();
- strTemp.Replace( ",", ";" );
+ strTemp.Replace( _T(","), _T(";") );
m_strParameterList = OclCommonEx::Convert( strTemp );
strFunctionData = strFunctionData.Right( strFunctionData.GetLength() - iPos - 1 );
}
Modified: trunk/GME/ConstraintManager/GMEConstraintPropertiesDialog.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMEConstraintPropertiesDialog.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/GMEConstraintPropertiesDialog.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -155,9 +155,9 @@
m_pageExpression.m_cmbContext.SetCurSel( iPos );
CString strExpression = OclCommonEx::Convert( m_spConstraintIn->GetExpression() );
- strExpression.Replace( "\r", "" );
- strExpression.Replace( "\n", "\r\n" );
- strExpression.Replace( "\t", " " );
+ strExpression.Replace( _T("\r"), _T("") );
+ strExpression.Replace( _T("\n"), _T("\r\n") );
+ strExpression.Replace( _T("\t"), _T(" ") );
m_pageExpression.m_edtExpression.SetWindowText( strExpression );
m_pageExpression.m_edtExpression.SetReadOnly( m_spConstraintIn->GetLocation() != OclGme::ConstraintBase::CL_PROJECT );
}
@@ -224,7 +224,7 @@
cbi.pszText = strItem.GetBuffer( strItem.GetLength() );
cbi.cchTextMax = strItem.GetLength();
if ( eType != OBJTYPE_NULL ) {
- cbi.iImage = ( eType != OBJTYPE_FOLDER ) ? eType + 10 : ( strItem == "meta::RootFolder" ) ? 9 : 10;
+ cbi.iImage = ( eType != OBJTYPE_FOLDER ) ? eType + 10 : ( strItem == _T("meta::RootFolder") ) ? 9 : 10;
cbi.iSelectedImage = cbi.iImage;
cbi.iOverlay = cbi.iImage;
}
@@ -273,14 +273,14 @@
CString strName;
m_pageIdentity.m_edtName.GetWindowText( strName );
if ( strName.IsEmpty() ) {
- AfxMessageBox( "Constraint cannot be untitled." );
+ AfxMessageBox( _T("Constraint cannot be untitled.") );
return;
}
CString strDescription;
m_pageIdentity.m_edtDescription.GetWindowText( strDescription );
if ( strDescription.IsEmpty() ) {
- AfxMessageBox( "Constraint must have description." );
+ AfxMessageBox( _T("Constraint must have description.") );
return;
}
@@ -295,7 +295,7 @@
CString strExpression;
m_pageExpression.m_edtExpression.GetWindowText( strExpression );
if ( strExpression.IsEmpty() ) {
- AfxMessageBox( "Constraint must have expression." );
+ AfxMessageBox( _T("Constraint must have expression.") );
return;
}
@@ -315,7 +315,7 @@
OclGme::ConstraintVector vecConstraints = (*it).second;
for ( unsigned int i = 0 ; i < vecConstraints.size() ; i++ )
if ( vecConstraints[ i ]->GetName() == OclCommonEx::Convert( strName ) && vecConstraints[ i ].Ptr() != m_spConstraintIn.Ptr() ) {
- AfxMessageBox( "Context [ " + strContext + " ] already has a constraint called " + strName + "." );
+ AfxMessageBox( _T("Context [ ") + strContext + _T(" ] already has a constraint called ") + strName + _T(".") );
return;
}
}
Modified: trunk/GME/ConstraintManager/GMEConstraintTreeCtrl.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMEConstraintTreeCtrl.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/GMEConstraintTreeCtrl.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -28,7 +28,7 @@
return -1;
if ( iImNum1 > iImNum2 )
return 1;
- return strcmp( strCaption1, strCaption2 );
+ return _tcscmp( strCaption1, strCaption2 );
}
//##############################################################################################################################################
Modified: trunk/GME/ConstraintManager/GMESmallMessageBox.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMESmallMessageBox.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/GMESmallMessageBox.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -56,11 +56,11 @@
{
CDialog::OnInitDialog();
- m_lblMessage.SetWindowText( "No Constraint violations were found." );
+ m_lblMessage.SetWindowText( _T("No Constraint violations were found.") );
m_ctrlProgress.SetRange32( 0, 100 );
m_ctrlProgress.SetPos( 100 );
m_btnOK.EnableWindow( TRUE );
- m_btnOK.SetWindowText( "OK" );
+ m_btnOK.SetWindowText( _T("OK") );
m_btnOK.ShowWindow( SW_SHOW );
m_bModeless = false;
@@ -70,7 +70,7 @@
void CSmallMessageBox::OnClickOK()
{
if (m_bModeless) {
- int nRet = ::AfxMessageBox("Are you sure you want to abort the constraint checking?", MB_YESNO | MB_ICONWARNING);
+ int nRet = ::AfxMessageBox(_T("Are you sure you want to abort the constraint checking?"), MB_YESNO | MB_ICONWARNING);
if (nRet == IDYES)
m_bCloseRequested = true;
else
@@ -109,10 +109,10 @@
AfxGetApp()->DoWaitCursor( 1 );
Create( IDD_PROGRESS_DIALOG );
ShowWindow( SW_SHOW );
- m_lblMessage.SetWindowText( "Evaluation of Constraints is in progress...." );
+ m_lblMessage.SetWindowText( _T("Evaluation of Constraints is in progress....") );
m_ctrlProgress.SetRange32( 0, iRange );
m_ctrlProgress.SetPos( 0 );
- m_btnOK.SetWindowText( "Abort" );
+ m_btnOK.SetWindowText( _T("Abort") );
m_bModeless = true;
}
Modified: trunk/GME/ConstraintManager/GMESyntacticSemanticDialog.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMESyntacticSemanticDialog.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/GMESyntacticSemanticDialog.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -87,40 +87,40 @@
m_lstConstraints.SetImageList( &m_lstConstraintImages, LVSIL_SMALL );
- int iLength = 3 * m_lstConstraints.GetStringWidth("Type") / 2;
- m_lstConstraints.InsertColumn( 0, "Type", LVCFMT_LEFT, iLength, -1 );
- iLength = 3 * m_lstConstraints.GetStringWidth("Context") / 2;
- m_lstConstraints.InsertColumn( 1, "Context", LVCFMT_LEFT, iLength, 1 );
- iLength = 3 * m_lstConstraints.GetStringWidth("Constraint(Definition)") / 2;
- m_lstConstraints.InsertColumn( 2, "Name", LVCFMT_LEFT, iLength, 2 );
+ int iLength = 3 * m_lstConstraints.GetStringWidth(_T("Type")) / 2;
+ m_lstConstraints.InsertColumn( 0, _T("Type"), LVCFMT_LEFT, iLength, -1 );
+ iLength = 3 * m_lstConstraints.GetStringWidth(_T("Context")) / 2;
+ m_lstConstraints.InsertColumn( 1, _T("Context"), LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstConstraints.GetStringWidth(_T("Constraint(Definition)")) / 2;
+ m_lstConstraints.InsertColumn( 2, _T("Name"), LVCFMT_LEFT, iLength, 2 );
m_lstConstraints.SetExtendedStyle( LVS_EX_FULLROWSELECT );
m_lstErrors.SetImageList( &m_lstErrorImages, LVSIL_SMALL );
- iLength = 3 * m_lstErrors.GetStringWidth("Code") / 2;
- m_lstErrors.InsertColumn( 0, "Code", LVCFMT_LEFT, iLength, -1 );
- iLength = 3 * m_lstErrors.GetStringWidth("Line") / 2;
- m_lstErrors.InsertColumn( 1, "Ln.", LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Code")) / 2;
+ m_lstErrors.InsertColumn( 0, _T("Code"), LVCFMT_LEFT, iLength, -1 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Line")) / 2;
+ m_lstErrors.InsertColumn( 1, _T("Ln."), LVCFMT_LEFT, iLength, 1 );
/*
// This column is commented out because this features is not implemented yet
// Be careful with uncommenting -> column numbers
- iLength = 3 * m_lstErrors.GetStringWidth("Column") / 2;
- m_lstErrors.InsertColumn( 2, "Col.", LVCFMT_LEFT, iLength, 2 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Column")) / 2;
+ m_lstErrors.InsertColumn( 2, _T("Col."), LVCFMT_LEFT, iLength, 2 );
*/
- iLength = 3 * m_lstErrors.GetStringWidth("Message") / 2;
- m_lstErrors.InsertColumn( 2, "Message", LVCFMT_LEFT, iLength, 2 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Message")) / 2;
+ m_lstErrors.InsertColumn( 2, _T("Message"), LVCFMT_LEFT, iLength, 2 );
m_lstErrors.SetExtendedStyle( LVS_EX_FULLROWSELECT );
m_lstExpression.SetImageList( &m_lstLineImages, LVSIL_SMALL );
- iLength = 3 * m_lstExpression.GetStringWidth("Line") / 2;
- m_lstExpression.InsertColumn( 0, "Line", LVCFMT_RIGHT, iLength, -1 );
- iLength = 3 * m_lstExpression.GetStringWidth("Expression") / 2;
- m_lstExpression.InsertColumn( 1, "Expression", LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstExpression.GetStringWidth(_T("Line")) / 2;
+ m_lstExpression.InsertColumn( 0, _T("Line"), LVCFMT_RIGHT, iLength, -1 );
+ iLength = 3 * m_lstExpression.GetStringWidth(_T("Expression")) / 2;
+ m_lstExpression.InsertColumn( 1, _T("Expression"), LVCFMT_LEFT, iLength, 1 );
m_lstExpression.SetExtendedStyle( LVS_EX_FULLROWSELECT );
@@ -316,12 +316,12 @@
CStringArray arrText;
CString strExpression = OclCommonEx::Convert( ( iPos >= iFunctions ) ? m_vecConstraints[ iPos - iFunctions ]->GetText() : m_vecConstraintFunctions[ iPos ]->GetText() );
- strExpression.Replace( "\r", "" );
- strExpression.Replace( "\n", "\r\n" );
- strExpression.Replace( "\t", " " );
+ strExpression.Replace( _T("\r"), _T("") );
+ strExpression.Replace( _T("\n"), _T("\r\n") );
+ strExpression.Replace( _T("\t"), _T(" ") );
int iFPos = 0;
do {
- iFPos = strExpression.Find( "\r\n" );
+ iFPos = strExpression.Find( _T("\r\n") );
if ( iFPos == -1 )
arrText.Add( strExpression );
else {
@@ -341,7 +341,7 @@
lvItem.iImage = 0;
lvItem.lParam = i;
CString strTemp;
- strTemp.Format( "%d", i + 1 );
+ strTemp.Format( _T("%d"), i + 1 );
lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstExpression.InsertItem( &lvItem );
@@ -383,9 +383,9 @@
lvItem.lParam = i;
CString strTemp;
if ( ex.GetCode() == -1 )
- strTemp = "None";
+ strTemp = _T("None");
else
- strTemp.Format( "%d", ex.GetCode() );
+ strTemp.Format( _T("%d"), ex.GetCode() );
lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstErrors.InsertItem( &lvItem );
@@ -397,9 +397,9 @@
lvItem.mask = LVIF_TEXT;
lvItem.iSubItem = 1;
if ( ex.GetLine() < 0 )
- strTemp = "?";
+ strTemp = _T("?");
else
- strTemp.Format( "%d", ex.GetLine() );
+ strTemp.Format( _T("%d"), ex.GetLine() );
lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
@@ -413,7 +413,7 @@
// Be careful with uncommenting -> column and subitem numbers
lvItem.iSubItem = 2;
- strTemp.Format( "%d", ex.GetColumn() );
+ strTemp.Format( _T("%d"), ex.GetColumn() );
lvItem.pszText = strTemp.GetBuffer( strTemp.GetLength() );
m_lstErrors.SetItem( &lvItem );
@@ -478,6 +478,6 @@
return ( eType1 < eType2 ) ? -1 : ( eType1 > eType2 ) ? 1 : 0;
}
if ( pSortInfo->iColumn == 1 )
- return strcmp( strCtx1, strCtx2 );
- return strcmp( strName1, strName2 );
+ return _tcscmp( strCtx1, strCtx2 );
+ return _tcscmp( strName1, strName2 );
}
\ No newline at end of file
Modified: trunk/GME/ConstraintManager/GMEViolationDialog.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMEViolationDialog.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/GMEViolationDialog.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -40,7 +40,7 @@
COMTRY
{
- CComBSTR app("GME.Application");
+ CComBSTR app(L"GME.Application");
CComPtr<IMgaClient> client;
COMTHROW(m_spProject->GetClientByName((BSTR)app, &client));
@@ -125,49 +125,49 @@
m_lstConstraints.SetImageList( &m_lstConstraintImages, LVSIL_SMALL );
- int iLength = 3 * m_lstConstraints.GetStringWidth("Type") / 2;
- m_lstConstraints.InsertColumn( 0, "Type", LVCFMT_LEFT, iLength, -1 );
- iLength = 3 * m_lstConstraints.GetStringWidth("Context") / 2;
- m_lstConstraints.InsertColumn( 1, "Context", LVCFMT_LEFT, iLength, 1 );
- iLength = 3 * m_lstConstraints.GetStringWidth("Name") / 2;
- m_lstConstraints.InsertColumn( 2, "Name", LVCFMT_LEFT, iLength, 2 );
+ int iLength = 3 * m_lstConstraints.GetStringWidth(_T("Type")) / 2;
+ m_lstConstraints.InsertColumn( 0, _T("Type"), LVCFMT_LEFT, iLength, -1 );
+ iLength = 3 * m_lstConstraints.GetStringWidth(_T("Context")) / 2;
+ m_lstConstraints.InsertColumn( 1, _T("Context"), LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstConstraints.GetStringWidth(_T("Name")) / 2;
+ m_lstConstraints.InsertColumn( 2, _T("Name"), LVCFMT_LEFT, iLength, 2 );
m_lstConstraints.SetExtendedStyle( LVS_EX_FULLROWSELECT );
m_lstErrors.SetImageList( &m_lstErrorImages, LVSIL_SMALL );
- iLength = 3 * m_lstErrors.GetStringWidth("Line") / 2;
- m_lstErrors.InsertColumn( 0, "Ln.", LVCFMT_LEFT, iLength, -1 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Line")) / 2;
+ m_lstErrors.InsertColumn( 0, _T("Ln."), LVCFMT_LEFT, iLength, -1 );
/*
// This column is commented out because this features is not implemented yet
// Be careful with uncommenting -> column numbers
- iLength = 3 * m_lstErrors.GetStringWidth("Column") / 2;
- m_lstErrors.InsertColumn( 2, "Col.", LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Column")) / 2;
+ m_lstErrors.InsertColumn( 2, _T("Col."), LVCFMT_LEFT, iLength, 1 );
*/
- iLength = 3 * m_lstErrors.GetStringWidth("Message") / 2;
- m_lstErrors.InsertColumn( 1, "Message", LVCFMT_LEFT, iLength, 1 );
- iLength = 3 * m_lstErrors.GetStringWidth("Signature") / 2;
- m_lstErrors.InsertColumn( 2, "Signature", LVCFMT_LEFT, iLength, 2 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Message")) / 2;
+ m_lstErrors.InsertColumn( 1, _T("Message"), LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstErrors.GetStringWidth(_T("Signature")) / 2;
+ m_lstErrors.InsertColumn( 2, _T("Signature"), LVCFMT_LEFT, iLength, 2 );
m_lstErrors.SetExtendedStyle( LVS_EX_FULLROWSELECT );
m_lstExpression.SetImageList( &m_lstLineImages, LVSIL_SMALL );
- iLength = 3 * m_lstExpression.GetStringWidth("Line") / 2;
- m_lstExpression.InsertColumn( 0, "Line", LVCFMT_RIGHT, iLength, -1 );
- iLength = 3 * m_lstExpression.GetStringWidth("Expression") / 2;
- m_lstExpression.InsertColumn( 1, "Expression", LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstExpression.GetStringWidth(_T("Line")) / 2;
+ m_lstExpression.InsertColumn( 0, _T("Line"), LVCFMT_RIGHT, iLength, -1 );
+ iLength = 3 * m_lstExpression.GetStringWidth(_T("Expression")) / 2;
+ m_lstExpression.InsertColumn( 1, _T("Expression"), LVCFMT_LEFT, iLength, 1 );
m_lstExpression.SetExtendedStyle( LVS_EX_FULLROWSELECT );
m_lstObjects.SetImageList( &m_lstLineImages, LVSIL_SMALL );
- iLength = 3 * m_lstObjects.GetStringWidth("Variable") / 2;
- m_lstObjects.InsertColumn( 0, "Variable", LVCFMT_RIGHT, iLength, -1 );
- iLength = 3 * m_lstObjects.GetStringWidth("Object") / 2;
- m_lstObjects.InsertColumn( 1, "Object", LVCFMT_LEFT, iLength, 1 );
+ iLength = 3 * m_lstObjects.GetStringWidth(_T("Variable")) / 2;
+ m_lstObjects.InsertColumn( 0, _T("Variable"), LVCFMT_RIGHT, iLength, -1 );
+ iLength = 3 * m_lstObjects.GetStringWidth(_T("Object")) / 2;
+ m_lstObjects.InsertColumn( 1, _T("Object"), LVCFMT_LEFT, iLength, 1 );
m_lstObjects.SetExtendedStyle( LVS_EX_FULLROWSELECT );
@@ -252,7 +252,7 @@
{
m_bExpanded = ! m_bExpanded;
- m_btnExpand.SetWindowText( ( m_bExpanded ) ? "Collapse" : "Expand" );
+ m_btnExpand.SetWindowText( ( m_bExpanded ) ? _T("Collapse") : _T("Expand") );
CRect rectEx;
m_btnExpand.GetWindowRect( rectEx );
@@ -437,22 +437,22 @@
CComBSTR bstr, id, nm;
COMTHROW( fco->get_ID( &id));
COMTHROW( fco->get_Name( &nm));
- bstr.Append("Constraint Violation: <A HREF=\"mga:");
+ bstr.Append(_T("Constraint Violation: <A HREF=\"mga:"));
bstr.AppendBSTR( id);
- bstr.Append("\">");
+ bstr.Append(_T("\">"));
bstr.AppendBSTR( nm);
- bstr.Append("</A>: ");
+ bstr.Append(_T("</A>: "));
bstr.Append(item.spConstraint.Ptr()->GetMessage().c_str());
COMTHROW(m_oleapp->ConsoleMessage(bstr, MSG_ERROR));
}
catch(hresult_exception &)// in case the constraint is not attached to any fco in the metamodel
{ // the constraint becomes project scoped, thus QueryInterface fails
CComBSTR bstr;
- bstr.Append("Constraint ");
+ bstr.Append(_T("Constraint "));
bstr.Append(item.spConstraint.Ptr()->GetFullName().c_str());
- bstr.Append(" Violated! Description: \"");
+ bstr.Append(_T(" Violated! Description: \""));
bstr.Append(item.spConstraint.Ptr()->GetMessage().c_str());
- bstr.Append("\".");
+ bstr.Append(_T("\"."));
COMTHROW(m_oleapp->ConsoleMessage(bstr, MSG_ERROR));
}
}
@@ -542,12 +542,12 @@
arrText.RemoveAll();
int serial = it->second.serial;
CString strExpression = it->second.text.c_str(); // OclCommonEx::Convert(it->second.text);
- strExpression.Replace( "\r", "" );
- strExpression.Replace( "\n", "\r\n" );
- strExpression.Replace( "\t", " " );
+ strExpression.Replace( _T("\r"), _T("") );
+ strExpression.Replace( _T("\n"), _T("\r\n") );
+ strExpression.Replace( _T("\t"), _T(" ") );
int iFPos = 0;
do {
- iFPos = strExpression.Find( "\r\n" );
+ iFPos = strExpression.Find( _T("\r\n") );
if ( iFPos == -1 )
arrText.Add( strExpression );
else {
@@ -569,7 +569,7 @@
lvItem.iImage = 0;
lvItem.lParam = it->second.serial*1000 +i;
CString strTemp;
- strTemp.Format( "%d", it->second.serial*1000 + i + 1 );
+ strTemp.Format( _T("%d"), it->second.serial*1000 + i + 1 );
lvItem.pszText = (TCHAR*)(LPCTSTR)strTemp; //.GetBuffer( strTemp.GetLength() );
m_lstExpression.InsertItem( &lvItem );
@@ -601,12 +601,12 @@
CStringArray arrText;
CString strExpression = m_vecRecords[ m_iSelectedConstraint ].spConstraint->GetText().c_str(); // OclCommonEx::Convert( m_vecRecords[ m_iSelectedConstraint ].spConstraint->GetText() );
- strExpression.Replace( "\r", "" );
- strExpression.Replace( "\n", "\r\n" );
- strExpression.Replace( "\t", " " );
+ strExpression.Replace( _T("\r"), _T("") );
+ strExpression.Replace( _T("\n"), _T("\r\n") );
+ strExpression.Replace( _T("\t"), _T(" ") );
int iFPos = 0;
do {
- iFPos = strExpression.Find( "\r\n" );
+ iFPos = strExpression.Find( _T("\r\n") );
if ( iFPos == -1 )
arrText.Add( strExpression );
else {
@@ -628,7 +628,7 @@
lvItem.iImage = 0;
lvItem.lParam = i;
CString strTemp;
- strTemp.Format( "%d", i + 1 );
+ strTemp.Format( _T("%d"), i + 1 );
lvItem.pszText = (TCHAR*)(LPCTSTR)strTemp; // .GetBuffer( strTemp.GetLength() );
m_lstExpression.InsertItem( &lvItem );
@@ -675,9 +675,9 @@
lvItem.lParam = i;
CString strTemp;
if ( vi.position.iLine < 0 )
- strTemp = "?";
+ strTemp = _T("?");
else
- strTemp.Format( "%d", vi.position.iLine );
+ strTemp.Format( _T("%d"), vi.position.iLine );
lvItem.pszText = (TCHAR*)(LPCTSTR)strTemp; //.GetBuffer( strTemp.GetLength() );
m_lstErrors.InsertItem( &lvItem );
@@ -773,7 +773,7 @@
}
CString str1 = ( pSortInfo->iColumn == 1 ) ? spConstraint1->GetContextType().c_str() : spConstraint1->GetName().c_str(); // OclCommonEx::Convert( ( pSortInfo->iColumn == 1 ) ? spConstraint1->GetContextType() : spConstraint1->GetName() );
CString str2 = ( pSortInfo->iColumn == 1 ) ? spConstraint2->GetContextType().c_str() : spConstraint2->GetName().c_str(); // OclCommonEx::Convert( ( pSortInfo->iColumn == 1 ) ? spConstraint2->GetContextType() : spConstraint2->GetName() );
- return strcmp( str1, str2 );
+ return _tcscmp( str1, str2 );
}
void CViolationDialog::GotoObject()
Modified: trunk/GME/ConstraintManager/OCLCommonEx.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLCommonEx.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLCommonEx.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -7,7 +7,6 @@
#include "Solve4786.h"
#include "OCLCommonEx.h"
-#include "Regexp.h"
#include "TokenEx.h"
#include <algorithm>
#include <string>
@@ -23,9 +22,7 @@
std::string Convert( const CString& strIn )
{
- CString strTemp( strIn );
- std::string strOut( strTemp.GetBuffer( strTemp.GetLength() ) );
- strTemp.ReleaseBuffer();
+ std::string strOut( static_cast<const char*>(CStringA(strIn)) );
return strOut;
}
@@ -45,11 +42,11 @@
bool bMultiple = false;
CStringArray arrElements;
CTokenEx tokenizer;
- tokenizer.Split( strCardinality, ",", arrElements );
+ tokenizer.Split( strCardinality, _T(","), arrElements );
for ( int i = 0 ; i < arrElements.GetSize() ; i++ ) {
CStringArray arrBounds;
- tokenizer.Split( arrElements[i], "..", arrBounds);
+ tokenizer.Split( arrElements[i], _T(".."), arrBounds);
if ( arrBounds.GetSize() == 0 ) {
bError = true;
@@ -57,7 +54,7 @@
}
else if ( arrBounds.GetSize() == 1 ) {
int iMultiplicity = 0;
- if ( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], "%ld", &iMultiplicity ) != 1 ) {
+ if ( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], _T("%ld"), &iMultiplicity ) != 1 ) {
bError = true;
break;
}
@@ -74,7 +71,7 @@
int iMultiplicityMin = 0;
int iMultiplicityMax = 0;
- if( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], "%ld", &iMultiplicityMin ) != 1 ) {
+ if( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], _T("%ld"), &iMultiplicityMin ) != 1 ) {
bError = true;
break;
}
@@ -87,8 +84,8 @@
bMultiple = true;
}
- if( _stscanf_s( (LPCTSTR) arrBounds[ 1 ], "%ld", &iMultiplicityMax ) != 1 ) {
- if ( arrBounds[ 1 ] != "*" ) {
+ if( _stscanf_s( (LPCTSTR) arrBounds[ 1 ], _T("%ld"), &iMultiplicityMax ) != 1 ) {
+ if ( arrBounds[ 1 ] != _T("*") ) {
bError = true;
break;
}
@@ -425,7 +422,7 @@
if ( strKind == "FCO" )
return true;
short sAbstract;
- if ( ! SUCCEEDED( spFCO->get_BoolAttrByName( CComBSTR( "IsAbstract" ), &sAbstract ) ) )
+ if ( ! SUCCEEDED( spFCO->get_BoolAttrByName( CComBSTR( L"IsAbstract" ), &sAbstract ) ) )
return false;
return ( sAbstract == 0 ) ? false : true;
}
@@ -693,13 +690,13 @@
CString strMetaRefs;
metaref_type ref;
COMTHROW( vecMetas[ i ]->get_MetaRef( &ref ) );
- strMetaRefs.Format( "#%d , ", ref );
+ strMetaRefs.Format( _T("#%d , "), ref );
CComPtr<IMgaMetaRoles> spRoles;
COMTHROW( spFCO->get_UsedInRoles( &spRoles ) );
MGACOLL_ITERATE( IMgaMetaRole, spRoles ) {
COMTHROW( MGACOLL_ITER->get_MetaRef( &ref ) );
CString strTemp;
- strTemp.Format( "#%d , ", ref );
+ strTemp.Format( _T("#%d , "), ref );
strMetaRefs += strTemp;
} MGACOLL_ITERATE_END;
Modified: trunk/GME/ConstraintManager/OCLFactory.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLFactory.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLFactory.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -82,7 +82,7 @@
virtual ~TypeFactory() {};
- virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector< OclMeta::Type* >& vecTypes, std::string& nameRes ) = 0;
+ virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector< std::unique_ptr<OclMeta::Type> >& vecTypes, std::string& nameRes ) = 0;
OclMeta::TypeManager* GetTypeManager() const
{
Modified: trunk/GME/ConstraintManager/OCLGMECMFacade.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLGMECMFacade.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLGMECMFacade.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -237,8 +237,7 @@
if ( strTemp.IsEmpty() )
m_infoEvaluation.iViolationCount = -2;
else {
- m_infoEvaluation.iViolationCount = atoi( strTemp.GetBuffer( strTemp.GetLength() ) );
- strTemp.ReleaseBuffer();
+ m_infoEvaluation.iViolationCount = _ttoi( strTemp );
if ( m_infoEvaluation.iViolationCount == 0 || m_infoEvaluation.iViolationCount < -2 || m_infoEvaluation.iViolationCount > 999 )
m_infoEvaluation.iViolationCount = -2;
}
@@ -250,10 +249,9 @@
if ( strTemp.IsEmpty() )
m_infoEvaluation.iModelDepth = 0; // 1; // terge
else {
- m_infoEvaluation.iModelDepth = atoi( strTemp.GetBuffer( strTemp.GetLength() ) );
+ m_infoEvaluation.iModelDepth = _ttoi( strTemp );
if ( m_infoEvaluation.iModelDepth < -1 || m_infoEvaluation.iModelDepth > 1 )
m_infoEvaluation.iModelDepth = -1;
- strTemp.ReleaseBuffer();
}
}
@@ -284,10 +282,10 @@
strTemp = ( info.bEnabledTracking ) ? "yes" : "no";
COMTHROW( spRootFolder->put_RegistryValue( CComBSTR( "ConstraintManagerSettings/Tracking" ), CComBSTR( strTemp ) ) );
- strTemp.Empty(); strTemp.Format( "%d", info.iViolationCount );
+ strTemp.Empty(); strTemp.Format( _T("%d"), info.iViolationCount );
COMTHROW( spRootFolder->put_RegistryValue( CComBSTR( "ConstraintManagerSettings/ViolationCount" ), CComBSTR( strTemp ) ) );
- strTemp.Empty(); strTemp.Format( "%d", info.iModelDepth );
+ strTemp.Empty(); strTemp.Format( _T("%d"), info.iModelDepth );
COMTHROW( spRootFolder->put_RegistryValue( CComBSTR( "ConstraintManagerSettings/ModelDepth" ), CComBSTR( strTemp ) ) );
}
@@ -309,7 +307,7 @@
COMTHROW( MGACOLL_ITER->get_Type( &eType ) );
if ( eType == CONSTRAINT_TYPE_FUNCTION ) {
OclGme::SpConstraintFunction spConstraintFunction( new OclGme::ConstraintFunction( MGACOLL_ITER ) );
- spConstraintFunction->SetNamespace( (LPCTSTR) strNmspc);
+ spConstraintFunction->SetNamespace( std::string(CStringA(strNmspc)));
spConstraintFunction->Register( m_pTreeManager );
vecFounds.push_back( spConstraintFunction );
}
@@ -458,7 +456,7 @@
COMTHROW( MGACOLL_ITER->get_Type( &eType ) );
if ( eType != CONSTRAINT_TYPE_FUNCTION ) {
OclGme::SpConstraint spConstraint( new OclGme::Constraint( strName, MGACOLL_ITER ) );
- spConstraint->SetNamespace( (LPCTSTR) strNmspc);
+ spConstraint->SetNamespace( std::string(CStringA(strNmspc)));
spConstraint->Register( m_pTreeManager );
vecFounds.push_back( spConstraint );
}
Modified: trunk/GME/ConstraintManager/OCLGMEECFacade.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLGMEECFacade.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLGMEECFacade.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -198,7 +198,7 @@
std::string strType = OclCommonEx::GetObjectName( vecFCOs[ i ].p );
if ( strType.empty() ) {
char chNum[ 100 ];
- _stprintf_s( chNum, "%lu", i );
+ sprintf_s( chNum, "%lu", i );
strType = "UntitledClass_" + std::string( chNum );
}
OclGme::SpConstraint pConstraint( new OclGme::Constraint( strType, spConstraint, bFieldsMandatory ) );
Modified: trunk/GME/ConstraintManager/OCLObjectExBasic.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLObjectExBasic.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLObjectExBasic.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -22,8 +22,8 @@
std::string PrintCollection( const std::string& strTypeName, const OclMeta::ObjectVector& vecElements )
{
CString chBuffer;
- chBuffer.Format( "%lu", vecElements.size() );
- return strTypeName + " { size: " + std::string( chBuffer ) + "; } ";
+ chBuffer.Format( _T("%lu"), vecElements.size() );
+ return strTypeName + " { size: " + std::string( CStringA(chBuffer) ) + "; } ";
/*
std::string strObject = strTypeName + " { " + std::string( chBuffer ) + " , [ ";
for ( int i = 0 ; i < vecElements.size() ; i++ ) {
@@ -265,7 +265,7 @@
std::string Real::Print() const
{
char chBuffer[ 100 ];
- _stprintf_s( chBuffer, "%lf", m_Value );
+ sprintf_s( chBuffer, "%lf", m_Value );
return "ocl::Real { " + std::string( chBuffer ) + " }";
}
@@ -319,7 +319,7 @@
double lValue;
Real::GetValue( lValue );
char chBuffer[ 100 ];
- _stprintf_s( chBuffer, "%ld", (long) lValue );
+ sprintf_s( chBuffer, "%ld", (long) lValue );
return "ocl::Integer { " + std::string( chBuffer ) + " }";
}
Modified: trunk/GME/ConstraintManager/OCLObjectExBasic.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLObjectExBasic.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLObjectExBasic.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -8,6 +8,7 @@
#ifndef OCLObjectExBasic_h
#define OCLObjectExBasic_h
+#include "StdAfx.h"
#include "OCLCommon.h"
#include "OCLObject.h"
Modified: trunk/GME/ConstraintManager/OCLObjectExGME.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLObjectExGME.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLObjectExGME.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -333,7 +333,7 @@
{
CString strName;
COMTHROW( m_Value->get_Name( PutOut( strName ) ) );
- return std::string("gme::Project { name: ") + (LPCTSTR) strName + "; }";
+ return std::string("gme::Project { name: ") + std::string(CStringA(strName)) + "; }";
}
}; // namespace OclGmeCM
\ No newline at end of file
Modified: trunk/GME/ConstraintManager/OCLTree.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLTree.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTree.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -97,9 +97,8 @@
}
bool bValid = true;
for ( unsigned int i = 0 ; i < vecType.size() ; i++ ) {
- OclMeta::Type* pType = NULL;
try {
- pType = m_pManager->GetTypeManager()->GetType( vecType[ i ], context.m_namespace);
+ OclMeta::Type* pType = m_pManager->GetTypeManager()->GetType( vecType[ i ], context.m_namespace);
if ( i != vecType.size() - 1 ) {
if ( ! pType->IsCompound() ) {
ADDEX( EXCEPTION1( EX_TYPE_ISNT_COMPOUND, vecType[ i ], position ) );
Modified: trunk/GME/ConstraintManager/OCLTree.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLTree.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTree.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -8,6 +8,7 @@
#ifndef OCLTree_h
#define OCLTree_h
+#include "StdAfx.h"
#include "OCLCommon.h"
#include "OCLException.h"
#include "OCLObject.h"
Modified: trunk/GME/ConstraintManager/OCLType.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLType.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLType.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -251,18 +251,16 @@
}
else {
if ( vecTypes.size() > 1 ) {
- DisposeVector<Type>( vecTypes );
typeResult.bIsValid = false;
typeResult.uResult.pException = new OclCommon::Exception( OclCommon::Exception::ET_SEMANTIC, EX_TYPE_AMBIGUOUS, strName );
}
else {
typeResult.bIsValid = true;
- typeResult.uResult.pType = vecTypes[ 0 ];
+ typeResult.uResult.pType = vecTypes[ 0 ].release();
}
}
}
catch ( OclCommon::Exception ex ) {
- DisposeVector<Type>( vecTypes );
typeResult.bIsValid = false;
typeResult.uResult.pException = new OclCommon::Exception( ex );
}
Modified: trunk/GME/ConstraintManager/OCLType.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLType.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLType.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -20,7 +20,7 @@
class CompoundType;
class TypeManager;
- typedef std::vector< Type* > TypeVector;
+ typedef std::vector< std::unique_ptr<Type> > TypeVector;
union UCallResult
{
Modified: trunk/GME/ConstraintManager/OCLTypeExBasic.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLTypeExBasic.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTypeExBasic.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -3222,82 +3222,82 @@
}
- void TypeFactory::GetTypes( const std::string& strName, const std::string& , std::vector<OclMeta::Type*>& vecTypes, std::string& strNameResult )
+ void TypeFactory::GetTypes( const std::string& strName, const std::string& , std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& strNameResult )
{
strNameResult = strName;
if ( strName == "ocl::Any" || strName == "Any" ) {
StringVector vecSupers;
- vecTypes.push_back( new OclMeta::Type( "ocl::Any", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TAny_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Any", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TAny_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Boolean" || strName == "bool" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Boolean", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Boolean", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Enumeration" || strName == "enum" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Enumeration", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Enumeration", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::String" || strName == "string" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::String", vecSupers, new TString_AttributeFactory(), new OclImplementation::AssociationFactory(), new TString_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::String", vecSupers, new TString_AttributeFactory(), new OclImplementation::AssociationFactory(), new TString_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Real" || strName == "real" || strName == "double" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Real", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TReal_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Real", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TReal_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Integer" || strName == "int" || strName == "long" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Real" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Integer", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TInteger_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Integer", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TInteger_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Type" || strName == "Type" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Type", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Type", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Collection" || strName == "Collection" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Collection", vecSupers, new TCollection_AttributeFactory(), new OclImplementation::AssociationFactory(), new TCollection_MethodFactory(),new TCollection_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Collection", vecSupers, new TCollection_AttributeFactory(), new OclImplementation::AssociationFactory(), new TCollection_MethodFactory(),new TCollection_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Set" || strName == "Set" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSet_MethodFactory(),new TSet_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSet_MethodFactory(),new TSet_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Sequence" || strName == "Sequence" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Sequence", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSequence_MethodFactory(),new TSequence_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Sequence", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSequence_MethodFactory(),new TSequence_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Bag" || strName == "Bag" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Bag", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TBag_MethodFactory(),new TBag_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Bag", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TBag_MethodFactory(),new TBag_IteratorFactory(), false ) ));
return;
}
}
Modified: trunk/GME/ConstraintManager/OCLTypeExBasic.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLTypeExBasic.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTypeExBasic.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -8,6 +8,7 @@
#ifndef OCLTypeExBasic_h
#define OCLTypeExBasic_h
+#include "StdAfx.h"
#include "OCLCommon.h"
#include "OCLFactory.h"
#include "OCLType.h"
@@ -205,7 +206,7 @@
: public OclImplementation::TypeFactory
{
public :
- virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<OclMeta::Type*>& vecTypes, std::string& nameRes );
+ virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& nameRes );
};
}; // namespace OclBasic
Modified: trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTypeExGMECM.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -12,7 +12,9 @@
#include "OCLCommonEx.h"
#include "math.h"
#include "mga.h"
-#include "Regexp.h"
+#include <regex>
+
+using std::unique_ptr;
#define NILNAMESPACE ""
@@ -99,12 +101,14 @@
{
DECL_STRING( strThis, GetThis() );
DECL_STRING( strRegExp, GetArgument( 0 ) );
- CString strRegExp2 = OclCommonEx::Convert( strRegExp );
- //strRegExp2.Replace( "\\", "\\\\" );
- Regexp tester( strRegExp2, true );
- if ( ! tester.CompiledOK() )
+ CStringA strRegExp2 = OclCommonEx::Convert( strRegExp );
+ try {
+ std::regex tester( strRegExp2 );
+
+ SetResult( CREATE_BOOLEAN( GetTypeManager(), std::regex_search(strThis, tester) ) );
+ } catch (std::regex_error&) {
ThrowException( "Regular Expression is not valid!" );
- SetResult( CREATE_BOOLEAN( GetTypeManager(), tester.Match( OclCommonEx::Convert( strThis ) ) ) );
+ }
}
};
@@ -2196,7 +2200,7 @@
{
}
- void TypeFactory::GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<OclMeta::Type*>& vecTypes, std::string& strNameResult )
+ void TypeFactory::GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<unique_ptr<OclMeta::Type>>& vecTypes, std::string& strNameResult )
{
strNameResult = strName; // will be overwritten by the GetDynamicTypes if it finds something
bool bHasNamespace = strName.find( "::" ) != std::string::npos;
@@ -2228,77 +2232,77 @@
if ( strName == "ocl::Any" || strName == "Any" ) {
StringVector vecSupers;
- vecTypes.push_back( new OclMeta::Type( "ocl::Any", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TAny_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Any", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TAny_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Boolean" || strName == "bool" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Boolean", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Boolean", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Enumeration" || strName == "enum" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Enumeration", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Enumeration", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::String" || strName == "string" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::String", vecSupers, new OclBasic::TString_AttributeFactory(), new OclImplementation::AssociationFactory(), new TStringEx_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::String", vecSupers, new OclBasic::TString_AttributeFactory(), new OclImplementation::AssociationFactory(), new TStringEx_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Real" || strName == "real" || strName == "double" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Real", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TReal_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Real", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TReal_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Integer" || strName == "int" || strName == "long" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Real" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Integer", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TInteger_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Integer", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TInteger_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Type" || strName == "Type" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Type", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Type", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Collection" || strName == "Collection" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Collection", vecSupers, new OclBasic::TCollection_AttributeFactory(), new OclImplementation::AssociationFactory(), new TCollectionEx_MethodFactory(),new OclBasic::TCollection_IteratorFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Collection", vecSupers, new OclBasic::TCollection_AttributeFactory(), new OclImplementation::AssociationFactory(), new TCollectionEx_MethodFactory(),new OclBasic::TCollection_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Set" || strName == "Set" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSet_MethodFactory(),new OclBasic::TSet_IteratorFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSet_MethodFactory(),new OclBasic::TSet_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Sequence" || strName == "Sequence" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Sequence", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSequence_MethodFactory(),new OclBasic::TSequence_IteratorFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Sequence", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSequence_MethodFactory(),new OclBasic::TSequence_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Bag" || strName == "Bag" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Bag", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TBag_MethodFactory(),new OclBasic::TBag_IteratorFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Bag", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TBag_MethodFactory(),new OclBasic::TBag_IteratorFactory(), false ) ));
return;
}
@@ -2306,86 +2310,86 @@
if ( strName == "ocl::OrderedSet" || strName == "OrderedSet" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Set" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::OrderedSet", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TOrderedSet_MethodFactory(),new OclBasic::TOrderedSet_IteratorFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::OrderedSet", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TOrderedSet_MethodFactory(),new OclBasic::TOrderedSet_IteratorFactory(), false ) ));
return;
}
// --
}
- void TypeFactory::GetStereotypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes )
+ void TypeFactory::GetStereotypes( const std::string& strName, std::vector<unique_ptr<OclMeta::Type>>& vecTypes )
{
if ( strName == "gme::Object" || strName == "Object" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "gme::Object", vecSupers, new TObject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TObject_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Object", vecSupers, new TObject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TObject_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::Folder" || strName == "Folder" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::Object" );
- vecTypes.push_back( new OclMeta::Type( "gme::Folder", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TFolder_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Folder", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TFolder_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::FCO" || strName == "FCO" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::Object" );
- vecTypes.push_back( new OclMeta::Type( "gme::FCO", vecSupers, new TFCO_AttributeFactory(), new OclImplementation::AssociationFactory(), new TFCO_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::FCO", vecSupers, new TFCO_AttributeFactory(), new OclImplementation::AssociationFactory(), new TFCO_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::Model" || strName == "Model" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Model", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TModel_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Model", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TModel_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::Atom" || strName == "Atom" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Atom", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Atom", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "gme::Set" || strName == "Set" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSet_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSet_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::Reference" || strName == "Reference" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Reference", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TReference_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Reference", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TReference_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::Connection" || strName == "Connection" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Connection", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnection_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Connection", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnection_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::Project" || strName == "Project" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "gme::Project", vecSupers, new TProject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TProject_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Project", vecSupers, new TProject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TProject_MethodFactory(), false ) ));
return;
}
if ( strName == "gme::ConnectionPoint" || strName == "ConnPoint" || strName == "ConnectionPoint" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "gme::ConnectionPoint", vecSupers, new TConnectionPoint_AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnectionPoint_MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::ConnectionPoint", vecSupers, new TConnectionPoint_AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnectionPoint_MethodFactory(), false ) ));
return;
}
}
- void TypeFactory::GetDynamicTypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes, std::string& strNameResult )
+ void TypeFactory::GetDynamicTypes( const std::string& strName, std::vector<unique_ptr<OclMeta::Type>>& vecTypes, std::string& strNameResult )
{
int jPos = strName.find( "gme::" );
int kPos = strName.find( "ocl::" );
@@ -2417,7 +2421,7 @@
std::string strSuperType = "gme::" + OclCommonEx::ObjectTypeToString( eType );
std::string strType = "meta::" + OclCommonEx::GetObjectName( vecMetas[ i ].p );
CComQIPtr<IMgaMetaFCO> spMetaFCO = vecMetas[ i ].p;
- vecTypes.push_back( new OclMeta::Type( strType, StringVector( 1, strSuperType ), ( ! spMetaFCO.p ) ? new OclImplementation::AttributeFactory() : new TFCODerived_AttributeFactory( spMetaFCO.p ), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(unique_ptr<OclMeta::Type>(new OclMeta::Type( strType, StringVector( 1, strSuperType ), ( ! spMetaFCO.p ) ? new OclImplementation::AttributeFactory() : new TFCODerived_AttributeFactory( spMetaFCO.p ), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
}
}
}
Modified: trunk/GME/ConstraintManager/OCLTypeExGMECM.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLTypeExGMECM.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTypeExGMECM.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -229,10 +229,10 @@
public :
TypeFactory( CComPtr<IMgaProject> spProject );
- virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<OclMeta::Type*>& vecTypes, std::string& strNameRes );
+ virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& strNameRes );
private :
- void GetStereotypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes );
- void GetDynamicTypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes, std::string& strNameResult );
+ void GetStereotypes( const std::string& strName, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes );
+ void GetDynamicTypes( const std::string& strName, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& strNameResult );
};
}; // namespace OclGmeCM
Modified: trunk/GME/ConstraintManager/OCLTypeExGMEEC.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLTypeExGMEEC.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTypeExGMEEC.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -936,7 +936,7 @@
{
}
- void TypeFactory::GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<OclMeta::Type*>& vecTypes, std::string& strNameResult )
+ void TypeFactory::GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& strNameResult )
{
strNameResult = strName;
bool bHasNamespace = strName.find( "::" ) != std::string::npos;
@@ -951,77 +951,77 @@
if ( strName == "ocl::Any" || strName == "Any" ) {
StringVector vecSupers;
- vecTypes.push_back( new OclMeta::Type( "ocl::Any", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TAny_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Any", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TAny_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Boolean" || strName == "bool" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Boolean", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Boolean", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Enumeration" || strName == "enum" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Enumeration", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Enumeration", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::String" || strName == "string" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::String", vecSupers, new OclBasic::TString_AttributeFactory(), new OclImplementation::AssociationFactory(), new TStringEx_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::String", vecSupers, new OclBasic::TString_AttributeFactory(), new OclImplementation::AssociationFactory(), new TStringEx_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Real" || strName == "real" || strName == "double" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Real", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TReal_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Real", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TReal_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Integer" || strName == "int" || strName == "long" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Real" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Integer", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TInteger_MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Integer", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TInteger_MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Type" || strName == "Type" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "ocl::Type", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "ocl::Type", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), false ) ));
return;
}
if ( strName == "ocl::Collection" || strName == "Collection" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Collection", vecSupers, new OclBasic::TCollection_AttributeFactory(), new OclImplementation::AssociationFactory(), new TCollectionEx_MethodFactory(),new OclBasic::TCollection_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Collection", vecSupers, new OclBasic::TCollection_AttributeFactory(), new OclImplementation::AssociationFactory(), new TCollectionEx_MethodFactory(),new OclBasic::TCollection_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Set" || strName == "Set" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSet_MethodFactory,new OclBasic::TSet_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSet_MethodFactory,new OclBasic::TSet_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Sequence" || strName == "Sequence" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Sequence", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSequence_MethodFactory(),new OclBasic::TSequence_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Sequence", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TSequence_MethodFactory(),new OclBasic::TSequence_IteratorFactory(), false ) ));
return;
}
if ( strName == "ocl::Bag" || strName == "Bag" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Collection" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::Bag", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TBag_MethodFactory(),new OclBasic::TBag_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::Bag", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TBag_MethodFactory(),new OclBasic::TBag_IteratorFactory(), false ) ));
return;
}
@@ -1029,93 +1029,93 @@
if ( strName == "ocl::OrderedSet" || strName == "OrderedSet" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Set" );
- vecTypes.push_back( new OclMeta::CompoundType( "ocl::OrderedSet", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TOrderedSet_MethodFactory(),new OclBasic::TOrderedSet_IteratorFactory(), false ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::CompoundType( "ocl::OrderedSet", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclBasic::TOrderedSet_MethodFactory(),new OclBasic::TOrderedSet_IteratorFactory(), false ) ));
return;
}
// --
}
- void TypeFactory::GetStereotypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes )
+ void TypeFactory::GetStereotypes( const std::string& strName, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes )
{
if ( strName == "gme::Object" || strName == "Object" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "gme::Object", vecSupers, new TObject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TObject_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Object", vecSupers, new TObject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TObject_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::Folder" || strName == "Folder" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::Object" );
- vecTypes.push_back( new OclMeta::Type( "gme::Folder", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TFolder_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Folder", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TFolder_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::FCO" || strName == "FCO" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::Object" );
- vecTypes.push_back( new OclMeta::Type( "gme::FCO", vecSupers, new TFCO_AttributeFactory(), new OclImplementation::AssociationFactory(), new TFCO_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::FCO", vecSupers, new TFCO_AttributeFactory(), new OclImplementation::AssociationFactory(), new TFCO_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::Model" || strName == "Model" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Model", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TModel_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Model", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TModel_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::Atom" || strName == "Atom" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Atom", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Atom", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), true ) ));
return;
}
if ( strName == "gme::Set" || strName == "Set" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSet_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Set", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TSet_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::Reference" || strName == "Reference" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Reference", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TReference_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Reference", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TReference_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::Connection" || strName == "Connection" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::FCO" );
- vecTypes.push_back( new OclMeta::Type( "gme::Connection", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnection_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Connection", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnection_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::Project" || strName == "Project" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "gme::Project", vecSupers, new TProject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TProject_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::Project", vecSupers, new TProject_AttributeFactory(), new OclImplementation::AssociationFactory(), new TProject_MethodFactory(), true ) ));
return;
}
if ( strName == "gme::ConnectionPoint" || strName == "ConnPoint" || strName == "ConnectionPoint" ) {
StringVector vecSupers;
vecSupers.push_back( "ocl::Any" );
- vecTypes.push_back( new OclMeta::Type( "gme::ConnectionPoint", vecSupers, new TConnectionPoint_AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnectionPoint_MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "gme::ConnectionPoint", vecSupers, new TConnectionPoint_AttributeFactory(), new OclImplementation::AssociationFactory(), new TConnectionPoint_MethodFactory(), true ) ));
return;
}
if ( strName == "meta::RootFolder" || strName == "RootFolder" ) {
StringVector vecSupers;
vecSupers.push_back( "gme::Folder" );
- vecTypes.push_back( new OclMeta::Type( "meta::RootFolder", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "meta::RootFolder", vecSupers, new OclImplementation::AttributeFactory(), new OclImplementation::AssociationFactory(), new OclImplementation::MethodFactory(), true ) ));
return;
}
}
- void TypeFactory::GetDynamicTypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes, std::string& )
+ void TypeFactory::GetDynamicTypes( const std::string& strName, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& )
{
std::string strRealName = strName;
if ( strName.size() > 6 && strName.substr( 0, 6 ) == "meta::" )
@@ -1167,7 +1167,7 @@
pAttFactory = new OclImplementation::AttributeFactory();
}
- vecTypes.push_back( new OclMeta::Type( "meta::" + strRealName, StringVector( 1, strSupertype ), pAttFactory, pAssFactory, new OclImplementation::MethodFactory(), true ) );
+ vecTypes.push_back(std::unique_ptr<OclMeta::Type>( new OclMeta::Type( "meta::" + strRealName, StringVector( 1, strSupertype ), pAttFactory, pAssFactory, new OclImplementation::MethodFactory(), true ) ));
}
}
} MGACOLL_ITERATE_END;
Modified: trunk/GME/ConstraintManager/OCLTypeExGMEEC.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLTypeExGMEEC.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OCLTypeExGMEEC.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -229,10 +229,10 @@
public :
TypeFactory( CComPtr<IMgaProject> spProject );
- virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<OclMeta::Type*>& vecTypes, std::string& nameRes );
+ virtual void GetTypes( const std::string& strName, const std::string& strNSpace, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& nameRes );
private :
- void GetStereotypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes );
- void GetDynamicTypes( const std::string& strName, std::vector<OclMeta::Type*>& vecTypes, std::string& strNameResult );
+ void GetStereotypes( const std::string& strName, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes );
+ void GetDynamicTypes( const std::string& strName, std::vector<std::unique_ptr<OclMeta::Type>>& vecTypes, std::string& strNameResult );
};
}; // namespace OclGmeEC
Modified: trunk/GME/ConstraintManager/OclConstraint.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OclConstraint.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/OclConstraint.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -4,6 +4,7 @@
// OCLConstraint.h
//
//###############################################################################################################################################
+#include "StdAfx.h"
#include "Solve4786.h"
#include "OCLConstraint.h"
Modified: trunk/GME/ConstraintManager/Solve4786.h
==============================================================================
--- trunk/GME/ConstraintManager/Solve4786.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/Solve4786.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -1,37 +1,2 @@
-#ifndef SOLVE4786_H
-#define SOLVE4786_H
-
-// Based on message from Yahoo!Groups boost at URL
-// http://groups.yahoo.com/group/boost/message/19264
-// Written by Paul Hollingsworth (http://PaulHollingsworth.com)
-
+#pragma once
#pragma warning(disable:4786)
-// http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP
-// states that yes, it's a compiler bug that #pragma warning(disable: 4786)
-// doesn't always work.
-
-// They don't, however, list a workaround.
-
-// I found that, very strangely, #including <iostream> made the
-// remaining 4786 warnings go away!
-
-// Of course, #including <iostream> is inefficient and
-// slows compilation - so I whittled away most of what's in
-// <iostream> and discovered that the "active ingredient" in <iostream>
-// appears to be a declaration of a static class, complete with
-// default constructor.
-
-// For some reason, this works around the bug!
-
-// Why does this work? Beats me, ask those smart guys at MS who wrote the
-// compiler.
-class msVC6_4786WorkAround
-{
-public:
- msVC6_4786WorkAround() {}
-};
-
-static msVC6_4786WorkAround
-WowIWonderWhatCrapCodeMustBeInTheCompilerToMakeThisWorkaroundWork;
-
-#endif // SOLVE4786_H
Modified: trunk/GME/ConstraintManager/StdAfx.h
==============================================================================
--- trunk/GME/ConstraintManager/StdAfx.h Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/StdAfx.h Wed Jun 1 16:35:47 2011 (r1337)
@@ -46,6 +46,12 @@
#define XASSERT(x) if(!(x)) COMTHROW( ((x), -1))
+#include "string"
+#ifdef UNICODE
+typedef std::wstring tstring;
+#else
+typedef std::string tstring;
+#endif
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
Modified: trunk/GME/ConstraintManager/TokenEx.cpp
==============================================================================
--- trunk/GME/ConstraintManager/TokenEx.cpp Wed Jun 1 15:29:20 2011 (r1336)
+++ trunk/GME/ConstraintManager/TokenEx.cpp Wed Jun 1 16:35:47 2011 (r1337)
@@ -122,14 +122,14 @@
int nSecond;
// Look for a UNC Name!
- if (Path.Left(2) == "\\\\") {
- int nFirst = Path.Find("\\",3);
- nSecond = Path.Find("\\",nFirst + 1);
+ if (Path.Left(2) == _T("\\\\")) {
+ int nFirst = Path.Find(_T("\\"),3);
+ nSecond = Path.Find(_T("\\"),nFirst + 1);
if (nSecond == -1) {
Drive = Path;
- Dir = "";
- FName = "";
- Ext = "";
+ Dir = _T("");
+ FName = _T("");
+ Ext = _T("");
}
else if (nSecond > nFirst)
Drive = Path.Left(nSecond);
@@ -141,15 +141,15 @@
if (UsingDirsOnly) {
Dir = Path.Right((Path.GetLength() - nSecond) - 1);
- FName = "";
- Ext = "";
+ FName = _T("");
+ Ext = _T("");
}
else {
int nDirEnd = Path.ReverseFind('\\');
if (nDirEnd == Path.GetLength()) {
- Dir = "";
- FName = "";
- Ext = "";
+ Dir = _T("");
+ FName = _T("");
+ Ext = _T("");
}
else {
@@ -160,7 +160,7 @@
if (nDirEnd > nFileEnd) {
FName = Path.Right(Path.GetLength() - nDirEnd);
- Ext = "";
+ Ext = _T("");
}
else {
FName = Path.Mid(nDirEnd + 1, (nFileEnd - nDirEnd) - 1);
@@ -169,7 +169,7 @@
}
else {
FName = Path.Right((Path.GetLength() - nDirEnd) - 1);
- Ext = "";
+ Ext = _T("");
}
}
}
More information about the gme-commit
mailing list