]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/ORTEDomainMgr.c
29fa02bc80dad03a0c063336632fffc23cd6eafa
[orte.git] / orte / liborte / ORTEDomainMgr.c
1 /*
2  *  $Id: ORTEDomainMgr.c,v 0.0.0.1      2003/09/12
3  *
4  *  DEBUG:  section 29                  Domain manager
5  *
6  *  -------------------------------------------------------------------  
7  *                                ORTE                                 
8  *                      Open Real-Time Ethernet                       
9  *                                                                    
10  *                      Copyright (C) 2001-2006                       
11  *  Department of Control Engineering FEE CTU Prague, Czech Republic  
12  *                      http://dce.felk.cvut.cz                       
13  *                      http://www.ocera.org                          
14  *                                                                    
15  *  Author:              Petr Smolik    petr@smoliku.cz             
16  *  Advisor:             Pavel Pisa                                   
17  *  Project Responsible: Zdenek Hanzalek                              
18  *  --------------------------------------------------------------------
19  *
20  *  This program is free software; you can redistribute it and/or modify
21  *  it under the terms of the GNU General Public License as published by
22  *  the Free Software Foundation; either version 2 of the License, or
23  *  (at your option) any later version.
24  *  
25  *  This program is distributed in the hope that it will be useful,
26  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28  *  GNU General Public License for more details.
29  *  
30  */ 
31
32 #include "orte_all.h"
33
34 /*****************************************************************************/
35 ORTEDomain *
36 ORTEDomainMgrCreate(int domain, ORTEDomainProp *prop,
37                     ORTEDomainAppEvents *events,Boolean suspended) {
38   ORTEDomain        *d;
39
40   debug(29,10) ("ORTEDomainMgrCreate: start\n");
41
42   d=ORTEDomainCreate(domain,prop,events,ORTE_TRUE);
43   if (!d)
44     return NULL;
45   
46   //Start threads
47   if (!suspended) {
48     ORTEDomainStart(d,                                  /* domain */
49                     ORTE_TRUE,                          /* recvUnicastMetarafficThread */
50                     ORTE_FALSE,                         /* recvMulticastMetarafficThread */
51                     ORTE_FALSE,                         /* recvUnicastUserdataThread */
52                     ORTE_FALSE,                         /* recvMulticastUserdataThread */
53                     ORTE_TRUE);                         /* sendThread */
54   }
55
56   debug(29,10) ("ORTEDomainMgrCreate: finished\n");
57   return d;
58 }
59
60 /*****************************************************************************/
61 Boolean
62 ORTEDomainMgrDestroy(ORTEDomain *d) {
63   Boolean ret;
64
65   debug(29,10) ("ORTEDomainMgrDestroy: start\n");
66
67   ret=ORTEDomainDestroy(d,ORTE_TRUE);
68
69   debug(29,10) ("ORTEDomainMgrDestroy: finished\n");
70   return ret;
71 }