Generate state machine classes for sip dialogs using SMC
This commit is contained in:
parent
5d95b9925a
commit
65cbc993c0
Binary file not shown.
|
@ -208,6 +208,38 @@
|
||||||
RelativePath=".\src\sip_dialog_subscribe.cxx"
|
RelativePath=".\src\sip_dialog_subscribe.cxx"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="sm"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_info_sm.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_invite_sm.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_message_sm.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_options_sm.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_publish_sm.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_register_sm.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_subscribe_sm.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
|
@ -225,10 +257,6 @@
|
||||||
RelativePath=".\src\pref.h"
|
RelativePath=".\src\pref.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\src\sm.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\stdint0.h"
|
RelativePath=".\src\stdint0.h"
|
||||||
>
|
>
|
||||||
|
@ -268,8 +296,76 @@
|
||||||
RelativePath=".\src\sip_dialog_subscribe.h"
|
RelativePath=".\src\sip_dialog_subscribe.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<Filter
|
||||||
|
Name="sm"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_info_sm.cxx"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_invite_sm.cxx"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_message_sm.cxx"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_options_sm.cxx"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_publish_sm.cxx"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_register_sm.cxx"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\sm_dialog_subscribe_sm.cxx"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="sm"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sm\sm_dialog_info.sm"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sm\sm_dialog_invite.sm"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sm\sm_dialog_message.sm"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sm\sm_dialog_options.sm"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sm\sm_dialog_publish.sm"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sm\sm_dialog_register.sm"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\sm\sm_dialog_subscribe.sm"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\statemap.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
%{
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
%}
|
||||||
|
|
||||||
|
%class sip_dialog_info
|
||||||
|
%header sip_dialog_info.h
|
||||||
|
%package dgo // PREF_NAMESPACE_VALUE ==> see 'pref.h' for more information
|
||||||
|
%start map_dialog_info::Initialized
|
||||||
|
|
||||||
|
%map map_dialog_info
|
||||||
|
%%
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
// Initialized
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
Initialized
|
||||||
|
Entry
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Exit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
%%
|
|
@ -0,0 +1,52 @@
|
||||||
|
%{
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
%}
|
||||||
|
|
||||||
|
%class sip_dialog_invite
|
||||||
|
%header sip_dialog_invite.h
|
||||||
|
%package dgo // PREF_NAMESPACE_VALUE ==> see 'pref.h' for more information
|
||||||
|
%start map_dialog_invite::Initialized
|
||||||
|
|
||||||
|
%map map_dialog_invite
|
||||||
|
%%
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
// Initialized
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
Initialized
|
||||||
|
Entry
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Exit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
%%
|
|
@ -0,0 +1,52 @@
|
||||||
|
%{
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
%}
|
||||||
|
|
||||||
|
%class sip_dialog_message
|
||||||
|
%header sip_dialog_message.h
|
||||||
|
%package dgo // PREF_NAMESPACE_VALUE ==> see 'pref.h' for more information
|
||||||
|
%start map_dialog_message::Initialized
|
||||||
|
|
||||||
|
%map map_dialog_message
|
||||||
|
%%
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
// Initialized
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
Initialized
|
||||||
|
Entry
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Exit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
%%
|
|
@ -0,0 +1,52 @@
|
||||||
|
%{
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
%}
|
||||||
|
|
||||||
|
%class sip_dialog_options
|
||||||
|
%header sip_dialog_options.h
|
||||||
|
%package dgo // PREF_NAMESPACE_VALUE ==> see 'pref.h' for more information
|
||||||
|
%start map_dialog_options::Initialized
|
||||||
|
|
||||||
|
|
||||||
|
%map map_dialog_options
|
||||||
|
%%
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
// Initialized
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
Initialized
|
||||||
|
Entry
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Exit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//
|
||||||
|
{
|
||||||
|
}
|
||||||
|
%%
|
|
@ -0,0 +1,52 @@
|
||||||
|
%{
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
%}
|
||||||
|
|
||||||
|
%class sip_dialog_publish
|
||||||
|
%header sip_dialog_publish.h
|
||||||
|
%package dgo // PREF_NAMESPACE_VALUE ==> see 'pref.h' for more information
|
||||||
|
%start map_dialog_publish::Initialized
|
||||||
|
|
||||||
|
%map map_dialog_publish
|
||||||
|
%%
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
// Initialized
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
Initialized
|
||||||
|
Entry
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Exit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
%%
|
|
@ -0,0 +1,53 @@
|
||||||
|
%{
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
%}
|
||||||
|
|
||||||
|
%class sip_dialog_register
|
||||||
|
%header sip_dialog_register.h
|
||||||
|
%package dgo // PREF_NAMESPACE_VALUE ==> see 'pref.h' for more information
|
||||||
|
%start map_dialog_register::Initialized
|
||||||
|
|
||||||
|
%map map_dialog_register
|
||||||
|
%%
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
// Initialized
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
Initialized
|
||||||
|
Entry
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
Exit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
%%
|
|
@ -0,0 +1,52 @@
|
||||||
|
%{
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
%}
|
||||||
|
|
||||||
|
%class sip_dialog_subscribe
|
||||||
|
%header sip_dialog_subscribe.h
|
||||||
|
%package dgo // PREF_NAMESPACE_VALUE ==> see 'pref.h' for more information
|
||||||
|
%start map_dialog_subscribe::Initialized
|
||||||
|
|
||||||
|
%map map_dialog_subscribe
|
||||||
|
%%
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
// Initialized
|
||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
Initialized
|
||||||
|
Entry
|
||||||
|
{
|
||||||
|
}
|
||||||
|
Exit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
%%
|
|
@ -24,4 +24,18 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog constructor */
|
||||||
|
sip_dialog::sip_dialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog destructor*/
|
||||||
|
sip_dialog::~sip_dialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,7 +28,7 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_SM_H__
|
#ifndef __DOUBANGO_DIALOG_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_SM_H__
|
#define __DOUBANGO_DIALOG_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
|
|
@ -24,4 +24,19 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog_info.h>
|
#include "sip_dialog_info.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog_info constructor*/
|
||||||
|
sip_dialog_info::sip_dialog_info()
|
||||||
|
:sm_ctx(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog_info destructor */
|
||||||
|
sip_dialog_info::~sip_dialog_info()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,14 +28,21 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_INFO_SM_H__
|
#ifndef __DOUBANGO_DIALOG_INFO_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_INFO_SM_H__
|
#define __DOUBANGO_DIALOG_INFO_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
#include "sm_dialog_info_sm.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
/* INFO */
|
/* INFO== RFC2976 - The SIP INFO Method */
|
||||||
class sip_dialog_info : public sip_dialog
|
class sip_dialog_info : public sip_dialog
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
sip_dialog_info();
|
||||||
|
~sip_dialog_info();
|
||||||
|
|
||||||
|
private:
|
||||||
|
sip_dialog_infoContext sm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
PREF_NAMESPACE_END
|
||||||
|
|
|
@ -24,4 +24,19 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog_invite.h>
|
#include "sip_dialog_invite.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog_invite constructor*/
|
||||||
|
sip_dialog_invite::sip_dialog_invite()
|
||||||
|
:sm_ctx(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog_invite destructor */
|
||||||
|
sip_dialog_invite::~sip_dialog_invite()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,14 +28,21 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_INVITE_SM_H__
|
#ifndef __DOUBANGO_DIALOG_INVITE_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_INVITE_SM_H__
|
#define __DOUBANGO_DIALOG_INVITE_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
#include "sm_dialog_invite_sm.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
/* INVITE */
|
/* INVITE */
|
||||||
class sip_dialog_invite : public sip_dialog
|
class sip_dialog_invite : public sip_dialog
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
sip_dialog_invite();
|
||||||
|
~sip_dialog_invite();
|
||||||
|
|
||||||
|
private:
|
||||||
|
sip_dialog_inviteContext sm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
PREF_NAMESPACE_END
|
||||||
|
|
|
@ -24,4 +24,19 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog_message.h>
|
#include "sip_dialog_message.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog_message constructor*/
|
||||||
|
sip_dialog_message::sip_dialog_message()
|
||||||
|
:sm_ctx(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog_message destructor */
|
||||||
|
sip_dialog_message::~sip_dialog_message()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,14 +28,21 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_MESSAGE_SM_H__
|
#ifndef __DOUBANGO_DIALOG_MESSAGE_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_MESSAGE_SM_H__
|
#define __DOUBANGO_DIALOG_MESSAGE_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
#include "sm_dialog_message_sm.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
/* MESSAGE */
|
/* MESSAGE */
|
||||||
class sip_dialog_message : public sip_dialog
|
class sip_dialog_message : public sip_dialog
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
sip_dialog_message();
|
||||||
|
~sip_dialog_message();
|
||||||
|
|
||||||
|
private:
|
||||||
|
sip_dialog_messageContext sm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
PREF_NAMESPACE_END
|
||||||
|
|
|
@ -25,4 +25,19 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog_options.h>
|
#include "sip_dialog_options.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog_message constructor*/
|
||||||
|
sip_dialog_options::sip_dialog_options()
|
||||||
|
:sm_ctx(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog_options destructor */
|
||||||
|
sip_dialog_options::~sip_dialog_options()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,14 +28,21 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_OPTIONS_SM_H__
|
#ifndef __DOUBANGO_DIALOG_OPTIONS_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_OPTIONS_SM_H__
|
#define __DOUBANGO_DIALOG_OPTIONS_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
#include "sm_dialog_options_sm.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
/* OPTIONS */
|
/* OPTIONS */
|
||||||
class sip_dialog_options : public sip_dialog
|
class sip_dialog_options : public sip_dialog
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
sip_dialog_options();
|
||||||
|
~sip_dialog_options();
|
||||||
|
|
||||||
|
private:
|
||||||
|
sip_dialog_optionsContext sm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
PREF_NAMESPACE_END
|
||||||
|
|
|
@ -24,4 +24,19 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog_publish.h>
|
#include "sip_dialog_publish.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog_publish constructor*/
|
||||||
|
sip_dialog_publish::sip_dialog_publish()
|
||||||
|
:sm_ctx(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog_options destructor */
|
||||||
|
sip_dialog_publish::~sip_dialog_publish()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,14 +28,21 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_PUBLISH_SM_H__
|
#ifndef __DOUBANGO_DIALOG_PUBLISH_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_PUBLISH_SM_H__
|
#define __DOUBANGO_DIALOG_PUBLISH_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
#include "sm_dialog_publish_sm.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
/* PUBLISH */
|
/* PUBLISH== RFC 3903: Session Initiation Protocol (SIP) Extension for Event State Publication */
|
||||||
class sip_dialog_pubish : public sip_dialog
|
class sip_dialog_publish : public sip_dialog
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
sip_dialog_publish();
|
||||||
|
~sip_dialog_publish();
|
||||||
|
|
||||||
|
private:
|
||||||
|
sip_dialog_publishContext sm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
PREF_NAMESPACE_END
|
||||||
|
|
|
@ -24,4 +24,19 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog_register.h>
|
#include "sip_dialog_register.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog_register constructor*/
|
||||||
|
sip_dialog_register::sip_dialog_register()
|
||||||
|
:sm_ctx(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog_register destructor */
|
||||||
|
sip_dialog_register::~sip_dialog_register()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,14 +28,21 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_REGISTER_SM_H__
|
#ifndef __DOUBANGO_DIALOG_REGISTER_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_REGISTER_SM_H__
|
#define __DOUBANGO_DIALOG_REGISTER_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
#include "sm_dialog_register_sm.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
/* REGISTER */
|
/* REGISTER */
|
||||||
class sip_dialog_register : public sip_dialog
|
class sip_dialog_register : public sip_dialog
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
sip_dialog_register();
|
||||||
|
~sip_dialog_register();
|
||||||
|
|
||||||
|
private:
|
||||||
|
sip_dialog_registerContext sm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
PREF_NAMESPACE_END
|
||||||
|
|
|
@ -24,4 +24,19 @@
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <sip_dialog_subscribe.h>
|
#include "sip_dialog_subscribe.h"
|
||||||
|
|
||||||
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
|
/* sip_dialog_subscribe constructor*/
|
||||||
|
sip_dialog_subscribe::sip_dialog_subscribe()
|
||||||
|
:sm_ctx(*this)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sip_dialog_subscribe destructor */
|
||||||
|
sip_dialog_subscribe::~sip_dialog_subscribe()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PREF_NAMESPACE_END
|
|
@ -28,14 +28,21 @@
|
||||||
#ifndef __DOUBANGO_DIALOG_SUBSCRIBE_SM_H__
|
#ifndef __DOUBANGO_DIALOG_SUBSCRIBE_SM_H__
|
||||||
#define __DOUBANGO_DIALOG_SUBSCRIBE_SM_H__
|
#define __DOUBANGO_DIALOG_SUBSCRIBE_SM_H__
|
||||||
|
|
||||||
#include <pref.h>
|
#include "pref.h"
|
||||||
#include <sip_dialog.h>
|
#include "sip_dialog.h"
|
||||||
|
#include "sm_dialog_subscribe_sm.h"
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
PREF_NAMESPACE_START
|
||||||
|
|
||||||
/* SUBSCRIBE */
|
/* SUBSCRIBE */
|
||||||
class sip_dialog_subscribe : public sip_dialog
|
class sip_dialog_subscribe : public sip_dialog
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
sip_dialog_subscribe();
|
||||||
|
~sip_dialog_subscribe();
|
||||||
|
|
||||||
|
private:
|
||||||
|
sip_dialog_subscribeContext sm_ctx;
|
||||||
};
|
};
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
PREF_NAMESPACE_END
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*
|
|
||||||
** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
|
||||||
|
|
||||||
This file is part of 'Doubango IMS Client Framework'.
|
|
||||||
|
|
||||||
'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Copyright (C) 2009 Doubango Telecom
|
|
||||||
*
|
|
||||||
* Authors: F0076RTY <imsframework@gmail.com>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __DOUBANGO_SM_H__
|
|
||||||
#define __DOUBANGO_SM_H__
|
|
||||||
|
|
||||||
#include "pref.h"
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
PREF_NAMESPACE_START
|
|
||||||
|
|
||||||
/* state machine class*/
|
|
||||||
template<class STATE, class TYPE>
|
|
||||||
class sm
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
/* callback function definition */
|
|
||||||
typedef void (TYPE::*callback)(void);
|
|
||||||
|
|
||||||
TYPE *obj;
|
|
||||||
|
|
||||||
std::map<STATE, callback> states;
|
|
||||||
STATE state_cur;
|
|
||||||
|
|
||||||
public:
|
|
||||||
/* state machine constructor */
|
|
||||||
sm(TYPE *instance){ this->obj = instance; }
|
|
||||||
/* state machine destructor */
|
|
||||||
~sm(void){ }
|
|
||||||
|
|
||||||
/* map the the state with the callback function */
|
|
||||||
void map_state_callback(STATE state, callback cb){ this->states[state] = cb;}
|
|
||||||
|
|
||||||
/* get the current state*/
|
|
||||||
STATE get_state_curr(void){ return this->state_cur; }
|
|
||||||
/* ste the current state */
|
|
||||||
void set_state_curr(STATE state){ state_cur = state; }
|
|
||||||
|
|
||||||
/* invoke/call the current state's callback function*/
|
|
||||||
void invoke_state_curr(void)
|
|
||||||
{
|
|
||||||
callback cb = this->states[state_cur];
|
|
||||||
if (cb) (this->obj->*callback)();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
PREF_NAMESPACE_END
|
|
||||||
|
|
||||||
#endif /* __DOUBANGO_SM_H__ */
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_info.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "sip_dialog_info.h"
|
||||||
|
#include "..\..\doubango\src\sm_dialog_info_sm.h"
|
||||||
|
|
||||||
|
using namespace statemap;
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Static class declarations.
|
||||||
|
map_dialog_info_Initialized map_dialog_info::Initialized("map_dialog_info::Initialized", 0);
|
||||||
|
|
||||||
|
void sip_dialog_infoState::Default(sip_dialog_infoContext& context)
|
||||||
|
{
|
||||||
|
assert(1==0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
|
@ -0,0 +1,123 @@
|
||||||
|
#ifndef _H_SM_DIALOG_INFO_SM
|
||||||
|
#define _H_SM_DIALOG_INFO_SM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_info.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
#define SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <statemap.h>
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Forward declarations.
|
||||||
|
class map_dialog_info;
|
||||||
|
class map_dialog_info_Initialized;
|
||||||
|
class map_dialog_info_Default;
|
||||||
|
class sip_dialog_infoState;
|
||||||
|
class sip_dialog_infoContext;
|
||||||
|
class sip_dialog_info;
|
||||||
|
|
||||||
|
class sip_dialog_infoState :
|
||||||
|
public statemap::State
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_infoState(const char *name, int stateId)
|
||||||
|
: statemap::State(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void Entry(sip_dialog_infoContext&) {};
|
||||||
|
virtual void Exit(sip_dialog_infoContext&) {};
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void Default(sip_dialog_infoContext& context);
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_info
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static map_dialog_info_Initialized Initialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_info_Default :
|
||||||
|
public sip_dialog_infoState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
map_dialog_info_Default(const char *name, int stateId)
|
||||||
|
: sip_dialog_infoState(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_info_Initialized :
|
||||||
|
public map_dialog_info_Default
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
map_dialog_info_Initialized(const char *name, int stateId)
|
||||||
|
: map_dialog_info_Default(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class sip_dialog_infoContext :
|
||||||
|
public statemap::FSMContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_infoContext(sip_dialog_info& owner)
|
||||||
|
: FSMContext(map_dialog_info::Initialized),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
sip_dialog_infoContext(sip_dialog_info& owner, const statemap::State& state)
|
||||||
|
: FSMContext(state),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void enterStartState()
|
||||||
|
{
|
||||||
|
getState().Entry(*this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sip_dialog_info& getOwner() const
|
||||||
|
{
|
||||||
|
return (_owner);
|
||||||
|
};
|
||||||
|
|
||||||
|
sip_dialog_infoState& getState() const
|
||||||
|
{
|
||||||
|
if (_state == NULL)
|
||||||
|
{
|
||||||
|
assert(1 == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dynamic_cast<sip_dialog_infoState&>(*_state));
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
sip_dialog_info& _owner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // _H_SM_DIALOG_INFO_SM
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_invite.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "sip_dialog_invite.h"
|
||||||
|
#include "..\..\doubango\src\sm_dialog_invite_sm.h"
|
||||||
|
|
||||||
|
using namespace statemap;
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Static class declarations.
|
||||||
|
map_dialog_invite_Initialized map_dialog_invite::Initialized("map_dialog_invite::Initialized", 0);
|
||||||
|
|
||||||
|
void sip_dialog_inviteState::Default(sip_dialog_inviteContext& context)
|
||||||
|
{
|
||||||
|
assert(1==0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
|
@ -0,0 +1,123 @@
|
||||||
|
#ifndef _H_SM_DIALOG_INVITE_SM
|
||||||
|
#define _H_SM_DIALOG_INVITE_SM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_invite.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
#define SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <statemap.h>
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Forward declarations.
|
||||||
|
class map_dialog_invite;
|
||||||
|
class map_dialog_invite_Initialized;
|
||||||
|
class map_dialog_invite_Default;
|
||||||
|
class sip_dialog_inviteState;
|
||||||
|
class sip_dialog_inviteContext;
|
||||||
|
class sip_dialog_invite;
|
||||||
|
|
||||||
|
class sip_dialog_inviteState :
|
||||||
|
public statemap::State
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_inviteState(const char *name, int stateId)
|
||||||
|
: statemap::State(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void Entry(sip_dialog_inviteContext&) {};
|
||||||
|
virtual void Exit(sip_dialog_inviteContext&) {};
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void Default(sip_dialog_inviteContext& context);
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_invite
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static map_dialog_invite_Initialized Initialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_invite_Default :
|
||||||
|
public sip_dialog_inviteState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
map_dialog_invite_Default(const char *name, int stateId)
|
||||||
|
: sip_dialog_inviteState(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_invite_Initialized :
|
||||||
|
public map_dialog_invite_Default
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
map_dialog_invite_Initialized(const char *name, int stateId)
|
||||||
|
: map_dialog_invite_Default(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class sip_dialog_inviteContext :
|
||||||
|
public statemap::FSMContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_inviteContext(sip_dialog_invite& owner)
|
||||||
|
: FSMContext(map_dialog_invite::Initialized),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
sip_dialog_inviteContext(sip_dialog_invite& owner, const statemap::State& state)
|
||||||
|
: FSMContext(state),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void enterStartState()
|
||||||
|
{
|
||||||
|
getState().Entry(*this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sip_dialog_invite& getOwner() const
|
||||||
|
{
|
||||||
|
return (_owner);
|
||||||
|
};
|
||||||
|
|
||||||
|
sip_dialog_inviteState& getState() const
|
||||||
|
{
|
||||||
|
if (_state == NULL)
|
||||||
|
{
|
||||||
|
assert(1 == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dynamic_cast<sip_dialog_inviteState&>(*_state));
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
sip_dialog_invite& _owner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // _H_SM_DIALOG_INVITE_SM
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_message.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "sip_dialog_message.h"
|
||||||
|
#include "..\..\doubango\src\sm_dialog_message_sm.h"
|
||||||
|
|
||||||
|
using namespace statemap;
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Static class declarations.
|
||||||
|
map_dialog_message_Initialized map_dialog_message::Initialized("map_dialog_message::Initialized", 0);
|
||||||
|
|
||||||
|
void sip_dialog_messageState::Default(sip_dialog_messageContext& context)
|
||||||
|
{
|
||||||
|
assert(1==0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
|
@ -0,0 +1,123 @@
|
||||||
|
#ifndef _H_SM_DIALOG_MESSAGE_SM
|
||||||
|
#define _H_SM_DIALOG_MESSAGE_SM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_message.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
#define SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <statemap.h>
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Forward declarations.
|
||||||
|
class map_dialog_message;
|
||||||
|
class map_dialog_message_Initialized;
|
||||||
|
class map_dialog_message_Default;
|
||||||
|
class sip_dialog_messageState;
|
||||||
|
class sip_dialog_messageContext;
|
||||||
|
class sip_dialog_message;
|
||||||
|
|
||||||
|
class sip_dialog_messageState :
|
||||||
|
public statemap::State
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_messageState(const char *name, int stateId)
|
||||||
|
: statemap::State(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void Entry(sip_dialog_messageContext&) {};
|
||||||
|
virtual void Exit(sip_dialog_messageContext&) {};
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void Default(sip_dialog_messageContext& context);
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_message
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static map_dialog_message_Initialized Initialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_message_Default :
|
||||||
|
public sip_dialog_messageState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
map_dialog_message_Default(const char *name, int stateId)
|
||||||
|
: sip_dialog_messageState(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_message_Initialized :
|
||||||
|
public map_dialog_message_Default
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
map_dialog_message_Initialized(const char *name, int stateId)
|
||||||
|
: map_dialog_message_Default(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class sip_dialog_messageContext :
|
||||||
|
public statemap::FSMContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_messageContext(sip_dialog_message& owner)
|
||||||
|
: FSMContext(map_dialog_message::Initialized),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
sip_dialog_messageContext(sip_dialog_message& owner, const statemap::State& state)
|
||||||
|
: FSMContext(state),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void enterStartState()
|
||||||
|
{
|
||||||
|
getState().Entry(*this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sip_dialog_message& getOwner() const
|
||||||
|
{
|
||||||
|
return (_owner);
|
||||||
|
};
|
||||||
|
|
||||||
|
sip_dialog_messageState& getState() const
|
||||||
|
{
|
||||||
|
if (_state == NULL)
|
||||||
|
{
|
||||||
|
assert(1 == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dynamic_cast<sip_dialog_messageState&>(*_state));
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
sip_dialog_message& _owner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // _H_SM_DIALOG_MESSAGE_SM
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_options.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "sip_dialog_options.h"
|
||||||
|
#include "..\..\doubango\src\sm_dialog_options_sm.h"
|
||||||
|
|
||||||
|
using namespace statemap;
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Static class declarations.
|
||||||
|
map_dialog_options_Initialized map_dialog_options::Initialized("map_dialog_options::Initialized", 0);
|
||||||
|
|
||||||
|
void sip_dialog_optionsState::Default(sip_dialog_optionsContext& context)
|
||||||
|
{
|
||||||
|
assert(1==0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
|
@ -0,0 +1,123 @@
|
||||||
|
#ifndef _H_SM_DIALOG_OPTIONS_SM
|
||||||
|
#define _H_SM_DIALOG_OPTIONS_SM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_options.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
#define SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <statemap.h>
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Forward declarations.
|
||||||
|
class map_dialog_options;
|
||||||
|
class map_dialog_options_Initialized;
|
||||||
|
class map_dialog_options_Default;
|
||||||
|
class sip_dialog_optionsState;
|
||||||
|
class sip_dialog_optionsContext;
|
||||||
|
class sip_dialog_options;
|
||||||
|
|
||||||
|
class sip_dialog_optionsState :
|
||||||
|
public statemap::State
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_optionsState(const char *name, int stateId)
|
||||||
|
: statemap::State(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void Entry(sip_dialog_optionsContext&) {};
|
||||||
|
virtual void Exit(sip_dialog_optionsContext&) {};
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void Default(sip_dialog_optionsContext& context);
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_options
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static map_dialog_options_Initialized Initialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_options_Default :
|
||||||
|
public sip_dialog_optionsState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
map_dialog_options_Default(const char *name, int stateId)
|
||||||
|
: sip_dialog_optionsState(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_options_Initialized :
|
||||||
|
public map_dialog_options_Default
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
map_dialog_options_Initialized(const char *name, int stateId)
|
||||||
|
: map_dialog_options_Default(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class sip_dialog_optionsContext :
|
||||||
|
public statemap::FSMContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_optionsContext(sip_dialog_options& owner)
|
||||||
|
: FSMContext(map_dialog_options::Initialized),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
sip_dialog_optionsContext(sip_dialog_options& owner, const statemap::State& state)
|
||||||
|
: FSMContext(state),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void enterStartState()
|
||||||
|
{
|
||||||
|
getState().Entry(*this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sip_dialog_options& getOwner() const
|
||||||
|
{
|
||||||
|
return (_owner);
|
||||||
|
};
|
||||||
|
|
||||||
|
sip_dialog_optionsState& getState() const
|
||||||
|
{
|
||||||
|
if (_state == NULL)
|
||||||
|
{
|
||||||
|
assert(1 == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dynamic_cast<sip_dialog_optionsState&>(*_state));
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
sip_dialog_options& _owner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // _H_SM_DIALOG_OPTIONS_SM
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_publish.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "sip_dialog_publish.h"
|
||||||
|
#include "..\..\doubango\src\sm_dialog_publish_sm.h"
|
||||||
|
|
||||||
|
using namespace statemap;
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Static class declarations.
|
||||||
|
map_dialog_publish_Initialized map_dialog_publish::Initialized("map_dialog_publish::Initialized", 0);
|
||||||
|
|
||||||
|
void sip_dialog_publishState::Default(sip_dialog_publishContext& context)
|
||||||
|
{
|
||||||
|
assert(1==0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
|
@ -0,0 +1,123 @@
|
||||||
|
#ifndef _H_SM_DIALOG_PUBLISH_SM
|
||||||
|
#define _H_SM_DIALOG_PUBLISH_SM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_publish.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
#define SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <statemap.h>
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Forward declarations.
|
||||||
|
class map_dialog_publish;
|
||||||
|
class map_dialog_publish_Initialized;
|
||||||
|
class map_dialog_publish_Default;
|
||||||
|
class sip_dialog_publishState;
|
||||||
|
class sip_dialog_publishContext;
|
||||||
|
class sip_dialog_publish;
|
||||||
|
|
||||||
|
class sip_dialog_publishState :
|
||||||
|
public statemap::State
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_publishState(const char *name, int stateId)
|
||||||
|
: statemap::State(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void Entry(sip_dialog_publishContext&) {};
|
||||||
|
virtual void Exit(sip_dialog_publishContext&) {};
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void Default(sip_dialog_publishContext& context);
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_publish
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static map_dialog_publish_Initialized Initialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_publish_Default :
|
||||||
|
public sip_dialog_publishState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
map_dialog_publish_Default(const char *name, int stateId)
|
||||||
|
: sip_dialog_publishState(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_publish_Initialized :
|
||||||
|
public map_dialog_publish_Default
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
map_dialog_publish_Initialized(const char *name, int stateId)
|
||||||
|
: map_dialog_publish_Default(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class sip_dialog_publishContext :
|
||||||
|
public statemap::FSMContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_publishContext(sip_dialog_publish& owner)
|
||||||
|
: FSMContext(map_dialog_publish::Initialized),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
sip_dialog_publishContext(sip_dialog_publish& owner, const statemap::State& state)
|
||||||
|
: FSMContext(state),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void enterStartState()
|
||||||
|
{
|
||||||
|
getState().Entry(*this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sip_dialog_publish& getOwner() const
|
||||||
|
{
|
||||||
|
return (_owner);
|
||||||
|
};
|
||||||
|
|
||||||
|
sip_dialog_publishState& getState() const
|
||||||
|
{
|
||||||
|
if (_state == NULL)
|
||||||
|
{
|
||||||
|
assert(1 == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dynamic_cast<sip_dialog_publishState&>(*_state));
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
sip_dialog_publish& _owner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // _H_SM_DIALOG_PUBLISH_SM
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_register.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "sip_dialog_register.h"
|
||||||
|
#include "..\..\doubango\src\sm_dialog_register_sm.h"
|
||||||
|
|
||||||
|
using namespace statemap;
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Static class declarations.
|
||||||
|
map_dialog_register_Initialized map_dialog_register::Initialized("map_dialog_register::Initialized", 0);
|
||||||
|
|
||||||
|
void sip_dialog_registerState::Default(sip_dialog_registerContext& context)
|
||||||
|
{
|
||||||
|
assert(1==0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
|
@ -0,0 +1,123 @@
|
||||||
|
#ifndef _H_SM_DIALOG_REGISTER_SM
|
||||||
|
#define _H_SM_DIALOG_REGISTER_SM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_register.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
#define SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <statemap.h>
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Forward declarations.
|
||||||
|
class map_dialog_register;
|
||||||
|
class map_dialog_register_Initialized;
|
||||||
|
class map_dialog_register_Default;
|
||||||
|
class sip_dialog_registerState;
|
||||||
|
class sip_dialog_registerContext;
|
||||||
|
class sip_dialog_register;
|
||||||
|
|
||||||
|
class sip_dialog_registerState :
|
||||||
|
public statemap::State
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_registerState(const char *name, int stateId)
|
||||||
|
: statemap::State(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void Entry(sip_dialog_registerContext&) {};
|
||||||
|
virtual void Exit(sip_dialog_registerContext&) {};
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void Default(sip_dialog_registerContext& context);
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_register
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static map_dialog_register_Initialized Initialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_register_Default :
|
||||||
|
public sip_dialog_registerState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
map_dialog_register_Default(const char *name, int stateId)
|
||||||
|
: sip_dialog_registerState(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_register_Initialized :
|
||||||
|
public map_dialog_register_Default
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
map_dialog_register_Initialized(const char *name, int stateId)
|
||||||
|
: map_dialog_register_Default(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class sip_dialog_registerContext :
|
||||||
|
public statemap::FSMContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_registerContext(sip_dialog_register& owner)
|
||||||
|
: FSMContext(map_dialog_register::Initialized),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
sip_dialog_registerContext(sip_dialog_register& owner, const statemap::State& state)
|
||||||
|
: FSMContext(state),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void enterStartState()
|
||||||
|
{
|
||||||
|
getState().Entry(*this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sip_dialog_register& getOwner() const
|
||||||
|
{
|
||||||
|
return (_owner);
|
||||||
|
};
|
||||||
|
|
||||||
|
sip_dialog_registerState& getState() const
|
||||||
|
{
|
||||||
|
if (_state == NULL)
|
||||||
|
{
|
||||||
|
assert(1 == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dynamic_cast<sip_dialog_registerState&>(*_state));
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
sip_dialog_register& _owner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // _H_SM_DIALOG_REGISTER_SM
|
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_subscribe.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// ** Copyright (C) 2009 Doubango Telecom <imsframework(at)gmail.com>
|
||||||
|
//
|
||||||
|
// This file is part of 'Doubango IMS Client Framework'.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// 'Doubango IMS Client Framework' is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with 'Doubango IMS Client Framework'. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ** For commercial use, you must purchase a proprietary license from Doubango Telecom.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
///* Copyright (C) 2009 Doubango Telecom
|
||||||
|
//*
|
||||||
|
//* Authors: F0076RTY <imsframework@gmail.com>
|
||||||
|
//*
|
||||||
|
//*/
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "sip_dialog_subscribe.h"
|
||||||
|
#include "..\..\doubango\src\sm_dialog_subscribe_sm.h"
|
||||||
|
|
||||||
|
using namespace statemap;
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Static class declarations.
|
||||||
|
map_dialog_subscribe_Initialized map_dialog_subscribe::Initialized("map_dialog_subscribe::Initialized", 0);
|
||||||
|
|
||||||
|
void sip_dialog_subscribeState::Default(sip_dialog_subscribeContext& context)
|
||||||
|
{
|
||||||
|
assert(1==0);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
|
@ -0,0 +1,123 @@
|
||||||
|
#ifndef _H_SM_DIALOG_SUBSCRIBE_SM
|
||||||
|
#define _H_SM_DIALOG_SUBSCRIBE_SM
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ex: set ro:
|
||||||
|
* DO NOT EDIT.
|
||||||
|
* generated by smc (http://smc.sourceforge.net/)
|
||||||
|
* from file : sm_dialog_subscribe.sm
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
#define SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <statemap.h>
|
||||||
|
|
||||||
|
namespace dgo
|
||||||
|
{
|
||||||
|
// Forward declarations.
|
||||||
|
class map_dialog_subscribe;
|
||||||
|
class map_dialog_subscribe_Initialized;
|
||||||
|
class map_dialog_subscribe_Default;
|
||||||
|
class sip_dialog_subscribeState;
|
||||||
|
class sip_dialog_subscribeContext;
|
||||||
|
class sip_dialog_subscribe;
|
||||||
|
|
||||||
|
class sip_dialog_subscribeState :
|
||||||
|
public statemap::State
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_subscribeState(const char *name, int stateId)
|
||||||
|
: statemap::State(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void Entry(sip_dialog_subscribeContext&) {};
|
||||||
|
virtual void Exit(sip_dialog_subscribeContext&) {};
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void Default(sip_dialog_subscribeContext& context);
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_subscribe
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static map_dialog_subscribe_Initialized Initialized;
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_subscribe_Default :
|
||||||
|
public sip_dialog_subscribeState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
map_dialog_subscribe_Default(const char *name, int stateId)
|
||||||
|
: sip_dialog_subscribeState(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class map_dialog_subscribe_Initialized :
|
||||||
|
public map_dialog_subscribe_Default
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
map_dialog_subscribe_Initialized(const char *name, int stateId)
|
||||||
|
: map_dialog_subscribe_Default(name, stateId)
|
||||||
|
{};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class sip_dialog_subscribeContext :
|
||||||
|
public statemap::FSMContext
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
sip_dialog_subscribeContext(sip_dialog_subscribe& owner)
|
||||||
|
: FSMContext(map_dialog_subscribe::Initialized),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
sip_dialog_subscribeContext(sip_dialog_subscribe& owner, const statemap::State& state)
|
||||||
|
: FSMContext(state),
|
||||||
|
_owner(owner)
|
||||||
|
{};
|
||||||
|
|
||||||
|
virtual void enterStartState()
|
||||||
|
{
|
||||||
|
getState().Entry(*this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sip_dialog_subscribe& getOwner() const
|
||||||
|
{
|
||||||
|
return (_owner);
|
||||||
|
};
|
||||||
|
|
||||||
|
sip_dialog_subscribeState& getState() const
|
||||||
|
{
|
||||||
|
if (_state == NULL)
|
||||||
|
{
|
||||||
|
assert(1 == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (dynamic_cast<sip_dialog_subscribeState&>(*_state));
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
sip_dialog_subscribe& _owner;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Local variables:
|
||||||
|
* buffer-read-only: t
|
||||||
|
* End:
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif // _H_SM_DIALOG_SUBSCRIBE_SM
|
|
@ -0,0 +1,14 @@
|
||||||
|
set ROOT_DIR=..\..
|
||||||
|
set SMC_HOME=%ROOT_DIR%\SMC_6_0_0
|
||||||
|
set SM_DIR=%ROOT_DIR%\doubango\sm
|
||||||
|
set SRC_DIR=%ROOT_DIR%\doubango\src
|
||||||
|
|
||||||
|
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_info.sm
|
||||||
|
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_invite.sm
|
||||||
|
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_message.sm
|
||||||
|
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_options.sm
|
||||||
|
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_publish.sm
|
||||||
|
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_register.sm
|
||||||
|
java -jar %SMC_HOME%\Smc.jar -c++ -suffix cxx -verbose -noex -d %SRC_DIR% %SM_DIR%\sm_dialog_subscribe.sm
|
||||||
|
|
||||||
|
pause
|
|
@ -0,0 +1,876 @@
|
||||||
|
#ifndef _H_STATEMAP
|
||||||
|
#define _H_STATEMAP
|
||||||
|
|
||||||
|
//
|
||||||
|
// The contents of this file are subject to the Mozilla Public
|
||||||
|
// License Version 1.1 (the "License"); you may not use this file
|
||||||
|
// except in compliance with the License. You may obtain a copy
|
||||||
|
// of the License at http://www.mozilla.org/MPL/
|
||||||
|
//
|
||||||
|
// Software distributed under the License is distributed on an
|
||||||
|
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||||
|
// implied. See the License for the specific language governing
|
||||||
|
// rights and limitations under the License.
|
||||||
|
//
|
||||||
|
// The Original Code is State Machine Compiler (SMC).
|
||||||
|
//
|
||||||
|
// The Initial Developer of the Original Code is Charles W. Rapp.
|
||||||
|
// Portions created by Charles W. Rapp are
|
||||||
|
// Copyright (C) 2000 - 2007. Charles W. Rapp.
|
||||||
|
// All Rights Reserved.
|
||||||
|
//
|
||||||
|
// Contributor(s):
|
||||||
|
//
|
||||||
|
// Namespace
|
||||||
|
// statemap
|
||||||
|
//
|
||||||
|
// Description
|
||||||
|
// This namespace contains the finite state machine context
|
||||||
|
// class. The user can derive FSM contexts from this class and
|
||||||
|
// interface to them with the methods of this class.
|
||||||
|
//
|
||||||
|
// Notes
|
||||||
|
// The finite state machine needs to be initialized to the
|
||||||
|
// starting state of the FSM. This must be done manually in
|
||||||
|
// the constructor of the derived class.
|
||||||
|
//
|
||||||
|
// Author
|
||||||
|
// C. W. Rapp
|
||||||
|
//
|
||||||
|
// RCS ID
|
||||||
|
// $Id: statemap.h,v 1.14 2009/03/01 18:20:40 cwrapp Exp $
|
||||||
|
//
|
||||||
|
// CHANGE LOG
|
||||||
|
// (See bottom of file)
|
||||||
|
//
|
||||||
|
|
||||||
|
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
||||||
|
#include <iostream>
|
||||||
|
#if defined(SMC_NO_EXCEPTIONS)
|
||||||
|
#include <cassert>
|
||||||
|
#endif // SMC_NO_EXCEPTIONS
|
||||||
|
#include <cstdio>
|
||||||
|
#elif defined(WIN32)
|
||||||
|
#include <iostream>
|
||||||
|
#include <windows.h>
|
||||||
|
#if defined(SMC_NO_EXCEPTIONS)
|
||||||
|
#include <cassert>
|
||||||
|
#endif // SMC_NO_EXCEPTIONS
|
||||||
|
#else
|
||||||
|
#include <iostream.h>
|
||||||
|
#if defined(SMC_NO_EXCEPTIONS)
|
||||||
|
#include <assert.h>
|
||||||
|
#endif // SMC_NO_EXCEPTIONS
|
||||||
|
#include <stdio.h>
|
||||||
|
#endif
|
||||||
|
#if ! defined(SMC_NO_EXCEPTIONS)
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <cstring>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Limit names to 100 ASCII characters.
|
||||||
|
// Why 100? Because it is a round number.
|
||||||
|
#define MAX_NAME_LEN 100
|
||||||
|
|
||||||
|
namespace statemap
|
||||||
|
{
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Routines.
|
||||||
|
//
|
||||||
|
|
||||||
|
inline char* copyString(const char *s)
|
||||||
|
{
|
||||||
|
char *retval = NULL;
|
||||||
|
|
||||||
|
if (s != NULL)
|
||||||
|
{
|
||||||
|
retval = new char[MAX_NAME_LEN + 1];
|
||||||
|
retval[MAX_NAME_LEN] = '\0';
|
||||||
|
(void) std::strncpy(retval, s, MAX_NAME_LEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
// Exception Classes.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef SMC_NO_EXCEPTIONS
|
||||||
|
// Base class for all SMC exceptions.
|
||||||
|
class SmcException :
|
||||||
|
public std::runtime_error
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member methods
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Destructor.
|
||||||
|
virtual ~SmcException() throw()
|
||||||
|
{};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Constructor.
|
||||||
|
SmcException(const std::string& reason)
|
||||||
|
: std::runtime_error(reason)
|
||||||
|
{};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Default construction not allowed.
|
||||||
|
SmcException();
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member data.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
// This class is thrown when a pop is issued on an empty
|
||||||
|
// state stack.
|
||||||
|
class PopOnEmptyStateStackException :
|
||||||
|
public SmcException
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member methods.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Default constructor.
|
||||||
|
PopOnEmptyStateStackException()
|
||||||
|
: SmcException("no state to pop from state stack")
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Destructor.
|
||||||
|
virtual ~PopOnEmptyStateStackException() throw()
|
||||||
|
{};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member data.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
// This class is thrown when a transition is issued
|
||||||
|
// but there is no current state. This happens when
|
||||||
|
// a transition is issued from within a transition
|
||||||
|
// action.
|
||||||
|
class StateUndefinedException :
|
||||||
|
public SmcException
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member methods.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Default constructor.
|
||||||
|
StateUndefinedException()
|
||||||
|
: SmcException("transition invoked while in transition")
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Destructor.
|
||||||
|
virtual ~StateUndefinedException() throw()
|
||||||
|
{};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member data.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
// This class is thrown when a transition is issued
|
||||||
|
// but there is no code to handle it.
|
||||||
|
class TransitionUndefinedException :
|
||||||
|
public SmcException
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member methods.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Default constructor.
|
||||||
|
TransitionUndefinedException()
|
||||||
|
: SmcException("no such transition in current state"),
|
||||||
|
_state(NULL),
|
||||||
|
_transition(NULL)
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Construct an exception using the specified state
|
||||||
|
// and transition.
|
||||||
|
TransitionUndefinedException(const char *state,
|
||||||
|
const char *transition)
|
||||||
|
: SmcException("no such transition in current state"),
|
||||||
|
_state(copyString(state)),
|
||||||
|
_transition(copyString(transition))
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Copy constructor.
|
||||||
|
TransitionUndefinedException(
|
||||||
|
const TransitionUndefinedException& ex)
|
||||||
|
: SmcException("no such transition in current state"),
|
||||||
|
_state(copyString(ex._state)),
|
||||||
|
_transition(copyString(ex._transition))
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Destructor.
|
||||||
|
virtual ~TransitionUndefinedException() throw()
|
||||||
|
{
|
||||||
|
if (_state != NULL)
|
||||||
|
{
|
||||||
|
delete[] _state;
|
||||||
|
_state = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_transition != NULL)
|
||||||
|
{
|
||||||
|
delete[] _transition;
|
||||||
|
_transition = NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Assignment operator.
|
||||||
|
const TransitionUndefinedException&
|
||||||
|
operator=(const TransitionUndefinedException& ex)
|
||||||
|
{
|
||||||
|
// Don't do self assignment.
|
||||||
|
if (this != &ex)
|
||||||
|
{
|
||||||
|
if (_state != NULL)
|
||||||
|
{
|
||||||
|
delete[] _state;
|
||||||
|
_state = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_transition != NULL)
|
||||||
|
{
|
||||||
|
delete[] _transition;
|
||||||
|
_transition = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
_state = copyString(ex._state);
|
||||||
|
_transition = copyString(ex._transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (*this);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the state. May be NULL.
|
||||||
|
const char* getState() const
|
||||||
|
{
|
||||||
|
return(_state);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the transition. May be NULL.
|
||||||
|
const char* getTransition() const
|
||||||
|
{
|
||||||
|
return (_transition);
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member data.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
char *_state;
|
||||||
|
char *_transition;
|
||||||
|
};
|
||||||
|
|
||||||
|
// This class is thrown when a state ID is either less than
|
||||||
|
// the minimal value or greater than the maximal value.
|
||||||
|
class IndexOutOfBoundsException :
|
||||||
|
public SmcException
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member methods.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Default constructor.
|
||||||
|
IndexOutOfBoundsException()
|
||||||
|
: SmcException("index out of bounds"),
|
||||||
|
_index(0),
|
||||||
|
_minIndex(0),
|
||||||
|
_maxIndex(0)
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Constructs an exception using the specified index,
|
||||||
|
// minimum index and maximum index.
|
||||||
|
IndexOutOfBoundsException(const int index,
|
||||||
|
const int minIndex,
|
||||||
|
const int maxIndex)
|
||||||
|
: SmcException("index out of bounds"),
|
||||||
|
_index(index),
|
||||||
|
_minIndex(minIndex),
|
||||||
|
_maxIndex(maxIndex)
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Copy constructor.
|
||||||
|
IndexOutOfBoundsException(
|
||||||
|
const IndexOutOfBoundsException& ex)
|
||||||
|
: SmcException("index out of bounds"),
|
||||||
|
_index(ex._index),
|
||||||
|
_minIndex(ex._minIndex),
|
||||||
|
_maxIndex(ex._maxIndex)
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Destructor.
|
||||||
|
virtual ~IndexOutOfBoundsException() throw()
|
||||||
|
{};
|
||||||
|
|
||||||
|
// Assignment operator.
|
||||||
|
const IndexOutOfBoundsException&
|
||||||
|
operator=(const IndexOutOfBoundsException& ex)
|
||||||
|
{
|
||||||
|
// Don't do self assignment.
|
||||||
|
if (this != &ex)
|
||||||
|
{
|
||||||
|
_index = ex._index;
|
||||||
|
_minIndex = ex._minIndex;
|
||||||
|
_maxIndex = ex._maxIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (*this);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the out-of-bounds index.
|
||||||
|
int getIndex() const
|
||||||
|
{
|
||||||
|
return(_index);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the minimum allowed index value.
|
||||||
|
int getMinIndex() const
|
||||||
|
{
|
||||||
|
return (_minIndex);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the maximum allowed index value.
|
||||||
|
int getMaxIndex() const
|
||||||
|
{
|
||||||
|
return (_maxIndex);
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member data.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
int _index;
|
||||||
|
int _minIndex;
|
||||||
|
int _maxIndex;
|
||||||
|
};
|
||||||
|
#endif // !SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
//
|
||||||
|
// end of Exception Classes.
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
|
||||||
|
class State
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member functions.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
|
||||||
|
const char* getName() const
|
||||||
|
{
|
||||||
|
return (_name);
|
||||||
|
};
|
||||||
|
|
||||||
|
int getId() const
|
||||||
|
{
|
||||||
|
return (_stateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
State(const char *name, int stateId)
|
||||||
|
: _name(NULL),
|
||||||
|
_stateId(stateId)
|
||||||
|
{
|
||||||
|
if (name != NULL)
|
||||||
|
{
|
||||||
|
_name = copyString(name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_name = copyString("NAME NOT SET");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~State()
|
||||||
|
{
|
||||||
|
if (_name != NULL)
|
||||||
|
{
|
||||||
|
delete[] _name;
|
||||||
|
_name = NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Make the default and copy constructors private to
|
||||||
|
// prevent their use.
|
||||||
|
State() {};
|
||||||
|
State(const State&) {};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member data.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// This state's printable name.
|
||||||
|
char *_name;
|
||||||
|
|
||||||
|
// This state's unique identifier.
|
||||||
|
int _stateId;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
class FSMContext
|
||||||
|
{
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Nested classes.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Implements the state stack.
|
||||||
|
class StateEntry
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// Member functions.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
StateEntry(State *state, StateEntry *next)
|
||||||
|
: _state(state),
|
||||||
|
_next(next)
|
||||||
|
{};
|
||||||
|
|
||||||
|
~StateEntry()
|
||||||
|
{
|
||||||
|
_state = NULL;
|
||||||
|
_next = NULL;
|
||||||
|
};
|
||||||
|
|
||||||
|
State* getState()
|
||||||
|
{
|
||||||
|
return(_state);
|
||||||
|
};
|
||||||
|
|
||||||
|
StateEntry* getNext()
|
||||||
|
{
|
||||||
|
return(_next);
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// Member data.
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
State *_state;
|
||||||
|
StateEntry *_next;
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// Friends
|
||||||
|
//
|
||||||
|
friend class FSMContext;
|
||||||
|
}; // end of class StateEntry
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member functions
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Destructor.
|
||||||
|
virtual ~FSMContext()
|
||||||
|
{
|
||||||
|
StateEntry *state;
|
||||||
|
|
||||||
|
if (_transition != NULL)
|
||||||
|
{
|
||||||
|
delete[] _transition;
|
||||||
|
_transition = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// But we did allocate the state stack.
|
||||||
|
while (_state_stack != NULL)
|
||||||
|
{
|
||||||
|
state = _state_stack;
|
||||||
|
_state_stack = _state_stack->_next;
|
||||||
|
delete state;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Comparison and assignment operators
|
||||||
|
// Assignment operator
|
||||||
|
FSMContext& operator=(const FSMContext& fsm)
|
||||||
|
{
|
||||||
|
// Don't do the assignment if the left and right
|
||||||
|
// hand sides are the same object.
|
||||||
|
if (this != &fsm)
|
||||||
|
{
|
||||||
|
_state = fsm._state;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(*this);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Starts the finite state machine running by executing
|
||||||
|
// the initial state's entry actions.
|
||||||
|
virtual void enterStartState()=0;
|
||||||
|
|
||||||
|
// Exact same object (is it me?)
|
||||||
|
int same(const FSMContext& fsm) const
|
||||||
|
{
|
||||||
|
return(this == &fsm);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the debug flag's current setting.
|
||||||
|
bool getDebugFlag()
|
||||||
|
{
|
||||||
|
return(_debug_flag);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sets the debug flag. A true value means debugging
|
||||||
|
// is on and false means off.
|
||||||
|
void setDebugFlag(bool flag)
|
||||||
|
{
|
||||||
|
_debug_flag = flag;
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef SMC_USES_IOSTREAMS
|
||||||
|
// Returns the stream to which debug output is written.
|
||||||
|
std::ostream& getDebugStream()
|
||||||
|
{
|
||||||
|
return (*_debug_stream);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sets the debug output stream.
|
||||||
|
void setDebugStream(std::ostream& debug_stream)
|
||||||
|
{
|
||||||
|
_debug_stream = &debug_stream;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif // SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
// Is this state machine already inside a transition?
|
||||||
|
// Yes if state is null.
|
||||||
|
bool isInTransition() const
|
||||||
|
{
|
||||||
|
return(_state == NULL ? true : false);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the current transition's name.
|
||||||
|
// Used only for debugging purposes.
|
||||||
|
char* getTransition()
|
||||||
|
{
|
||||||
|
return (_transition);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Saves away the transition name only if debugging
|
||||||
|
// is turned on.
|
||||||
|
void setTransition(const char *transition)
|
||||||
|
{
|
||||||
|
if (_transition != NULL)
|
||||||
|
{
|
||||||
|
delete[] _transition;
|
||||||
|
_transition = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
_transition = copyString(transition);
|
||||||
|
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Clears the current state.
|
||||||
|
void clearState()
|
||||||
|
{
|
||||||
|
_previous_state = _state;
|
||||||
|
_state = NULL;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns the state which a transition left.
|
||||||
|
// May be NULL.
|
||||||
|
State* getPreviousState()
|
||||||
|
{
|
||||||
|
return (_previous_state);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sets the current state to the specified state.
|
||||||
|
void setState(const State& state)
|
||||||
|
{
|
||||||
|
_state = const_cast<State *>(&state);
|
||||||
|
|
||||||
|
if (_debug_flag == true)
|
||||||
|
{
|
||||||
|
#ifdef SMC_USES_IOSTREAMS
|
||||||
|
*_debug_stream << "NEW STATE : "
|
||||||
|
<< _state->getName()
|
||||||
|
<< std::endl;
|
||||||
|
#else
|
||||||
|
TRACE("NEW STATE : %s\n\r",
|
||||||
|
_state->getName());
|
||||||
|
#endif // SMC_USES_IOSTREAMS
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Returns true if the state stack is empty and false
|
||||||
|
// otherwise.
|
||||||
|
bool isStateStackEmpty() const
|
||||||
|
{
|
||||||
|
return (_state_stack == NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns the state stack's depth.
|
||||||
|
int getStateStackDepth() const
|
||||||
|
{
|
||||||
|
StateEntry *state_ptr;
|
||||||
|
int retval;
|
||||||
|
|
||||||
|
for (state_ptr = _state_stack, retval = 0;
|
||||||
|
state_ptr != NULL;
|
||||||
|
state_ptr = state_ptr->getNext(), ++retval)
|
||||||
|
;
|
||||||
|
|
||||||
|
return (retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Push the current state on top of the state stack
|
||||||
|
// and make the specified state the current state.
|
||||||
|
void pushState(const State& state)
|
||||||
|
{
|
||||||
|
StateEntry *new_entry;
|
||||||
|
|
||||||
|
// Do the push only if there is a state to be pushed
|
||||||
|
// on the stack.
|
||||||
|
if (_state != NULL)
|
||||||
|
{
|
||||||
|
new_entry = new StateEntry(_state, _state_stack);
|
||||||
|
_state_stack = new_entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
_state = const_cast<State *>(&state);
|
||||||
|
|
||||||
|
if (_debug_flag == true)
|
||||||
|
{
|
||||||
|
#ifdef SMC_USES_IOSTREAMS
|
||||||
|
*_debug_stream << "PUSH TO STATE: "
|
||||||
|
<< _state->getName()
|
||||||
|
<< std::endl;
|
||||||
|
#else
|
||||||
|
TRACE("PUSH TO STATE: %s\n\r",
|
||||||
|
_state->getName());
|
||||||
|
#endif // SMC_USES_IOSTREAMS
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Make the state on top of the state stack the
|
||||||
|
// current state.
|
||||||
|
void popState()
|
||||||
|
{
|
||||||
|
StateEntry *entry;
|
||||||
|
|
||||||
|
// Popping when there was no previous push is an error.
|
||||||
|
#ifdef SMC_NO_EXCEPTIONS
|
||||||
|
assert(_state_stack != NULL);
|
||||||
|
#else
|
||||||
|
if (_state_stack == NULL)
|
||||||
|
{
|
||||||
|
throw PopOnEmptyStateStackException();
|
||||||
|
}
|
||||||
|
#endif // SMC_NO_EXCEPTIONS
|
||||||
|
|
||||||
|
_state = _state_stack->getState();
|
||||||
|
entry = _state_stack;
|
||||||
|
_state_stack = _state_stack->getNext();
|
||||||
|
delete entry;
|
||||||
|
|
||||||
|
if (_debug_flag == true)
|
||||||
|
{
|
||||||
|
#ifdef SMC_USES_IOSTREAMS
|
||||||
|
*_debug_stream << "POP TO STATE : "
|
||||||
|
<< _state->getName()
|
||||||
|
<< std::endl;
|
||||||
|
#else
|
||||||
|
TRACE("POP TO STATE : %s\n\r",
|
||||||
|
_state->getName());
|
||||||
|
#endif // SMC_USES_IOSTREAMS
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Remove all states from the state stack.
|
||||||
|
void emptyStateStack()
|
||||||
|
{
|
||||||
|
StateEntry *state_ptr,
|
||||||
|
*next_ptr;
|
||||||
|
|
||||||
|
for (state_ptr = _state_stack;
|
||||||
|
state_ptr != NULL;
|
||||||
|
state_ptr = next_ptr)
|
||||||
|
{
|
||||||
|
next_ptr = state_ptr->getNext();
|
||||||
|
delete state_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
_state_stack = NULL;
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Default constructor.
|
||||||
|
FSMContext(const State& state)
|
||||||
|
: _state(const_cast<State *>(&state)),
|
||||||
|
_previous_state(NULL),
|
||||||
|
_state_stack(NULL),
|
||||||
|
_transition(NULL),
|
||||||
|
#ifdef SMC_USES_IOSTREAMS
|
||||||
|
_debug_flag(false),
|
||||||
|
_debug_stream(&std::cerr)
|
||||||
|
#else
|
||||||
|
_debug_flag(false)
|
||||||
|
#endif // SMC_USES_IOSTREAMS
|
||||||
|
{};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// I don't believe that it makes sense to copy a
|
||||||
|
// context. It may make sense to copy the application
|
||||||
|
// class but the new object is *not* in the same
|
||||||
|
// state as the old - the new object must start in
|
||||||
|
// the FSM's initial state. Therefore, the copy
|
||||||
|
// constructor is private in order to prevent it
|
||||||
|
// being used.
|
||||||
|
FSMContext(const FSMContext&)
|
||||||
|
{};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------
|
||||||
|
// Member data
|
||||||
|
//
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// The current state of the finite state machine.
|
||||||
|
State *_state;
|
||||||
|
|
||||||
|
// Remember which state a transition left.
|
||||||
|
State *_previous_state;
|
||||||
|
|
||||||
|
// The stack of pushed states.
|
||||||
|
StateEntry *_state_stack;
|
||||||
|
|
||||||
|
// The current transition *name*. Use for debugging
|
||||||
|
// purposes.
|
||||||
|
char *_transition;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// When this flag is set to true, this class will print
|
||||||
|
// out debug messages.
|
||||||
|
bool _debug_flag;
|
||||||
|
|
||||||
|
// Include the following only if C++ iostreams are being used.
|
||||||
|
#ifdef SMC_USES_IOSTREAMS
|
||||||
|
// When FSM debugging is on, debug messages will be
|
||||||
|
// written to this output stream. This stream is set to
|
||||||
|
// standard error by default.
|
||||||
|
std::ostream *_debug_stream;
|
||||||
|
#endif // SMC_USES_IOSTREAMS
|
||||||
|
|
||||||
|
}; // end of class FSMContext
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// CHANGE LOG
|
||||||
|
// $Log: statemap.h,v $
|
||||||
|
// Revision 1.14 2009/03/01 18:20:40 cwrapp
|
||||||
|
// Preliminary v. 6.0.0 commit.
|
||||||
|
//
|
||||||
|
// Revision 1.13 2008/05/20 18:31:12 cwrapp
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Committing release 5.1.0.
|
||||||
|
//
|
||||||
|
// Modified Files:
|
||||||
|
// Makefile README.txt smc.mk tar_list.txt bin/Smc.jar
|
||||||
|
// examples/Ant/EX1/build.xml examples/Ant/EX2/build.xml
|
||||||
|
// examples/Ant/EX3/build.xml examples/Ant/EX4/build.xml
|
||||||
|
// examples/Ant/EX5/build.xml examples/Ant/EX6/build.xml
|
||||||
|
// examples/Ant/EX7/build.xml examples/Ant/EX7/src/Telephone.java
|
||||||
|
// examples/Java/EX1/Makefile examples/Java/EX4/Makefile
|
||||||
|
// examples/Java/EX5/Makefile examples/Java/EX6/Makefile
|
||||||
|
// examples/Java/EX7/Makefile examples/Ruby/EX1/Makefile
|
||||||
|
// lib/statemap.jar lib/C++/statemap.h lib/Java/Makefile
|
||||||
|
// lib/Php/statemap.php lib/Scala/Makefile
|
||||||
|
// lib/Scala/statemap.scala net/sf/smc/CODE_README.txt
|
||||||
|
// net/sf/smc/README.txt net/sf/smc/Smc.java
|
||||||
|
// ----------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Revision 1.12 2007/12/28 12:34:40 cwrapp
|
||||||
|
// Version 5.0.1 check-in.
|
||||||
|
//
|
||||||
|
// Revision 1.11 2007/08/05 12:58:54 cwrapp
|
||||||
|
// Version 5.0.1 check-in. See net/sf/smc/CODE_README.txt for more information.
|
||||||
|
//
|
||||||
|
// Revision 1.10 2007/01/15 00:23:50 cwrapp
|
||||||
|
// Release 4.4.0 initial commit.
|
||||||
|
//
|
||||||
|
// Revision 1.9 2006/07/11 18:28:22 cwrapp
|
||||||
|
// Move SmcException::copyString() to a package-wide routine.
|
||||||
|
//
|
||||||
|
// Revision 1.8 2006/04/22 12:45:24 cwrapp
|
||||||
|
// Version 4.3.1
|
||||||
|
//
|
||||||
|
// Revision 1.7 2005/06/08 11:09:14 cwrapp
|
||||||
|
// + Updated Python code generator to place "pass" in methods with empty
|
||||||
|
// bodies.
|
||||||
|
// + Corrected FSM errors in Python example 7.
|
||||||
|
// + Removed unnecessary includes from C++ examples.
|
||||||
|
// + Corrected errors in top-level makefile's distribution build.
|
||||||
|
//
|
||||||
|
// Revision 1.6 2005/05/28 18:44:13 cwrapp
|
||||||
|
// Updated C++, Java and Tcl libraries, added CSharp, Python and VB.
|
||||||
|
//
|
||||||
|
// Revision 1.2 2005/02/21 19:01:42 charlesr
|
||||||
|
// Changed State::_id to State::_stateId because of Object-C++
|
||||||
|
// reserved word conflict.
|
||||||
|
//
|
||||||
|
// Revision 1.1 2004/05/31 13:44:41 charlesr
|
||||||
|
// Added support for non-iostreams output.
|
||||||
|
//
|
||||||
|
// Revision 1.0 2003/12/14 20:37:49 charlesr
|
||||||
|
// Initial revision
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue