networkcontrol/qoslib/src/qos_event.cpp
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "qoslib.h"
       
    17 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    18 #include <networking/qoslib_internal.h>
       
    19 #endif
       
    20 
       
    21 // CQoSEventBase
       
    22 /**
       
    23 Constructor; sets the QoS event type.
       
    24 
       
    25 @publishedPartner
       
    26 @released
       
    27 @capability NetworkServices Restrict QoS operations in similar way as 
       
    28 normal socket operations.
       
    29 @param aEventType QoS event type (values defined in enum TQoSEvent).
       
    30 */
       
    31 EXPORT_C CQoSEventBase::CQoSEventBase(TInt aEventType) 
       
    32 	: iEventType(aEventType)
       
    33 	{
       
    34 	}
       
    35 
       
    36 /**
       
    37 Gets the QoS event type.
       
    38 
       
    39 @publishedPartner
       
    40 @released
       
    41 @capability NetworkServices Restrict QoS operations in similar way as 
       
    42 normal socket operations.
       
    43 @return QoS event type (values defined in enum TQoSEvent).
       
    44 */
       
    45 EXPORT_C TInt CQoSEventBase::EventType() const
       
    46 	{
       
    47 	return iEventType;
       
    48 	}
       
    49 
       
    50 /**
       
    51 Constructor; sets the QoS parameters. 
       
    52  
       
    53 The class takes a reference to the CQoSParameters argument so the caller must
       
    54 keep that argument in scope whilst this class is being used.
       
    55  
       
    56 @publishedPartner
       
    57 @released
       
    58 @capability NetworkServices Restrict QoS operations in similar way as 
       
    59 normal socket operations.
       
    60 @param aParameters QoS parameters. 
       
    61 */
       
    62 EXPORT_C CQoSConfirmEvent::CQoSConfirmEvent(CQoSParameters& aParameters) 
       
    63 	: CQoSEventBase(EQoSEventConfirm)
       
    64 	{
       
    65 	iParameters = &aParameters;
       
    66 	}
       
    67 
       
    68 // CQoSFailureEvent
       
    69 /**
       
    70 Constructor. Sets the QoS parameters and reason code.
       
    71 
       
    72 The class takes a reference to the CQoSParameters argument, so the caller 
       
    73 must keep that argument in scope whilst this class is being used.
       
    74 
       
    75 @publishedPartner
       
    76 @released
       
    77 @capability NetworkServices Restrict QoS operations in similar way as 
       
    78 normal socket operations.
       
    79 @param aParameters QoS parameters.
       
    80 @param aReason Reason code specifies the success or failure of the request.
       
    81 */
       
    82 EXPORT_C CQoSFailureEvent::CQoSFailureEvent(CQoSParameters& aParameters, 
       
    83 											TInt aReason) 
       
    84 	: CQoSEventBase(EQoSEventFailure), iReason(aReason)
       
    85 	{
       
    86 	iParameters = &aParameters;
       
    87 	}
       
    88 
       
    89 /**
       
    90 Gets the QoS parameters.
       
    91 
       
    92 @publishedPartner
       
    93 @released
       
    94 @capability NetworkServices Restrict QoS operations in similar way as 
       
    95 normal socket operations.
       
    96 @return QoS parameters.
       
    97 */
       
    98 //lint -e{1763} thinks this indirectly modifies class -- wants return to be const?
       
    99 EXPORT_C CQoSParameters* CQoSConfirmEvent::Parameters() const
       
   100 	{
       
   101 	return iParameters;
       
   102 	}
       
   103 
       
   104 /**
       
   105 Gets the QoS parameters.
       
   106 
       
   107 @publishedPartner
       
   108 @released
       
   109 @capability NetworkServices Restrict QoS operations in similar way as 
       
   110 normal socket operations.
       
   111 @return QoS parameters.
       
   112 */
       
   113 //lint -e{1763} thinks this indirectly modifies class -- wants return to be const?
       
   114 EXPORT_C CQoSParameters* CQoSFailureEvent::Parameters() const
       
   115 	{
       
   116 	return iParameters;
       
   117 	}
       
   118 
       
   119 /**
       
   120 Gets the reason code. 
       
   121 
       
   122 Reason code specifies the success or failure of the request.
       
   123 
       
   124 @publishedPartner
       
   125 @released
       
   126 @capability NetworkServices Restrict QoS operations in similar way as 
       
   127 normal socket operations.
       
   128 @return Reason code.
       
   129 */
       
   130 EXPORT_C TInt CQoSFailureEvent::Reason() const
       
   131 	{
       
   132 	return iReason;
       
   133 	}
       
   134 
       
   135 // CQoSAdaptEvent
       
   136 /**
       
   137 Constructor.
       
   138 
       
   139 Sets the QoS parameters and reason code.
       
   140 
       
   141 The class takes a reference to the CQoSParameters argument, so the caller 
       
   142 must keep that argument in scope whilst this class is being used.
       
   143 
       
   144 @publishedPartner
       
   145 @released
       
   146 @capability NetworkServices Restrict QoS operations in similar way as 
       
   147 normal socket operations.
       
   148 @param aParameters QoS parameters.
       
   149 @param aReason Reason code specifies the success or failure of the request.
       
   150 */
       
   151 EXPORT_C CQoSAdaptEvent::CQoSAdaptEvent(CQoSParameters& aParameters, 
       
   152 										TInt aReason) 
       
   153 	: CQoSEventBase(EQoSEventAdapt), iReason(aReason)
       
   154 	{
       
   155 	iParameters = &aParameters;
       
   156 	}
       
   157 
       
   158 /**
       
   159 Gets the QoS parameters.
       
   160 
       
   161 @publishedPartner
       
   162 @released
       
   163 @capability NetworkServices Restrict QoS operations in similar way as 
       
   164 normal socket operations.
       
   165 @return QoS parameters.
       
   166 */
       
   167 //lint -e{1763} thinks this indirectly modifies class -- wants return to be const?
       
   168 EXPORT_C CQoSParameters* CQoSAdaptEvent::Parameters() const
       
   169 	{
       
   170 	return iParameters;
       
   171 	}
       
   172 
       
   173 /**
       
   174 Gets the reason code. 
       
   175  
       
   176 Reason code specifies the success or failure of the request.
       
   177 
       
   178 @publishedPartner
       
   179 @released
       
   180 @capability NetworkServices Restrict QoS operations in similar way as 
       
   181 normal socket operations.
       
   182 @return Reason code.
       
   183 */
       
   184 EXPORT_C TInt CQoSAdaptEvent::Reason() const
       
   185 	{
       
   186 	return iReason;
       
   187 	}
       
   188 
       
   189 // CQoSChannelEvent
       
   190 /**
       
   191 Constructor.
       
   192 
       
   193 Sets the QoS parameters and reason code.
       
   194 
       
   195 The class takes a reference to the CQoSParameters argument so the caller 
       
   196 must keep that argument in scope whilst this class is being used.
       
   197 
       
   198 @publishedPartner
       
   199 @released
       
   200 @capability NetworkServices Restrict QoS operations in similar way as 
       
   201 normal socket operations.
       
   202 @param aParameters QoS parameters.
       
   203 @param aReason Reason code specifies the success or failure of the request.
       
   204 */
       
   205 EXPORT_C CQoSChannelEvent::CQoSChannelEvent(CQoSParameters* aParameters, 
       
   206 											TInt aReason) 
       
   207 	: CQoSEventBase(EQoSEventChannel), iReason(aReason)
       
   208 	{
       
   209 	iParameters = aParameters;
       
   210 	}
       
   211 
       
   212 /**
       
   213 Gets the QoS parameters.
       
   214 
       
   215 @publishedPartner
       
   216 @released
       
   217 @capability NetworkServices Restrict QoS operations in similar way as 
       
   218 normal socket operations.
       
   219 @return QoS parameters.
       
   220 */
       
   221 //lint -e{1763} thinks this indirectly modifies class -- wants return to be const?
       
   222 EXPORT_C CQoSParameters* CQoSChannelEvent::Parameters() const
       
   223 	{
       
   224 	return iParameters;
       
   225 	}
       
   226 
       
   227 /**
       
   228 Gets the reason code. 
       
   229 
       
   230 Reason code specifies the success or failure of the request.
       
   231 
       
   232 @publishedPartner
       
   233 @released
       
   234 @capability NetworkServices Restrict QoS operations in similar way as 
       
   235 normal socket operations.
       
   236 @return Reason code: KErrNone, if an existing channel was found; otherwise, 
       
   237 an error code.
       
   238 */
       
   239 EXPORT_C TInt CQoSChannelEvent::Reason() const
       
   240 	{
       
   241 	return iReason;
       
   242 	}
       
   243 
       
   244 
       
   245 // CQoSJoinEvent
       
   246 /**
       
   247 Constructor.
       
   248  
       
   249 Sets the selector and reason code. Selector specifies the socket 
       
   250 that was attached to the QoS channel.
       
   251 
       
   252 @publishedPartner
       
   253 @released
       
   254 @capability NetworkServices Restrict QoS operations in similar way as 
       
   255 normal socket operations.
       
   256 @param aSelector Selector specifies the socket that was attached to the QoS 
       
   257 channel.
       
   258 @param aReason Reason code specifies the success or failure of the request.
       
   259 */
       
   260 EXPORT_C CQoSJoinEvent::CQoSJoinEvent(const TQoSSelector& aSelector, 
       
   261 									  TInt aReason) 
       
   262 	: CQoSEventBase(EQoSEventJoin), iReason(aReason)
       
   263 	{
       
   264 	iSelector = aSelector;
       
   265 	}
       
   266 
       
   267 /**
       
   268 Gets the selector that was attached to the QoS channel.
       
   269 
       
   270 @publishedPartner
       
   271 @released
       
   272 @capability NetworkServices Restrict QoS operations in similar way as 
       
   273 normal socket operations.
       
   274 @return Selector that was attached to the QoS channel.
       
   275 */
       
   276 EXPORT_C const TQoSSelector& CQoSJoinEvent::Selector() const
       
   277 	{
       
   278 	return iSelector;
       
   279 	}
       
   280 
       
   281 /**
       
   282 Gets the reason code. 
       
   283 
       
   284 Reason code specifies the success or failure of the request.
       
   285 
       
   286 @publishedPartner
       
   287 @released
       
   288 @capability NetworkServices Restrict QoS operations in similar way as 
       
   289 normal socket operations.
       
   290 @return Reason code.
       
   291 */
       
   292 EXPORT_C TInt CQoSJoinEvent::Reason() const
       
   293 	{
       
   294 	return iReason;
       
   295 	}
       
   296 
       
   297 // CQoSLeaveEvent
       
   298 /**
       
   299 Constructor. 
       
   300 
       
   301 Sets the selector and reason code. Selector specifies the socket 
       
   302 that was detached from the QoS channel.
       
   303 
       
   304 @publishedPartner
       
   305 @released
       
   306 @capability NetworkServices Restrict QoS operations in similar way as 
       
   307 normal socket operations.
       
   308 @param aSelector Selector specifies the socket that was detached from the QoS
       
   309 channel.
       
   310 @param aReason Reason code specifies the success or failure of the request.
       
   311 */
       
   312 EXPORT_C CQoSLeaveEvent::CQoSLeaveEvent(const TQoSSelector& aSelector, 
       
   313 										TInt aReason) 
       
   314 	: CQoSEventBase(EQoSEventLeave), iReason(aReason)
       
   315 	{
       
   316 	iSelector = aSelector;
       
   317 	}
       
   318 
       
   319 /**
       
   320 Gets the selector that was detached from the QoS channel.
       
   321 
       
   322 @publishedPartner
       
   323 @released
       
   324 @capability NetworkServices Restrict QoS operations in similar way as 
       
   325 normal socket operations.
       
   326 @return Selector that was detached from the QoS channel.
       
   327 */
       
   328 EXPORT_C const TQoSSelector& CQoSLeaveEvent::Selector() const
       
   329 	{
       
   330 	return iSelector;
       
   331 	}
       
   332 
       
   333 /**
       
   334 Gets the reason code. 
       
   335 
       
   336 Reason code specifies the success or failure of the request.
       
   337 
       
   338 @publishedPartner
       
   339 @released
       
   340 @capability NetworkServices Restrict QoS operations in similar way as 
       
   341 normal socket operations.
       
   342 @return Reason code.
       
   343 */
       
   344 EXPORT_C TInt CQoSLeaveEvent::Reason() const
       
   345 	{
       
   346 	return iReason;
       
   347 	}
       
   348 
       
   349 // CQoSLoadEvent
       
   350 /**
       
   351 Constructor.
       
   352 
       
   353 @publishedPartner
       
   354 @released
       
   355 @capability NetworkServices Restrict QoS operations in similar way as 
       
   356 normal socket operations.
       
   357 @param aEvent Sets the event type (EQoSEventLoadPolicyFile or 
       
   358 EQoSEventUnloadPolicyFile).
       
   359 @param aReason Reason code.
       
   360 @param aFileName The name of the policy file.
       
   361 */
       
   362 EXPORT_C CQoSLoadEvent::CQoSLoadEvent(const TQoSEvent& aEvent, TInt aReason, 
       
   363 									  const TDesC& aFileName) 
       
   364 	: CQoSEventBase(aEvent), iReason(aReason), iFileName(aFileName)
       
   365 	{
       
   366 	}
       
   367 
       
   368 /**
       
   369 Gets the name of the policy file. 
       
   370 
       
   371 @publishedPartner
       
   372 @released
       
   373 @capability NetworkServices Restrict QoS operations in similar way as 
       
   374 normal socket operations.
       
   375 @return The name of the policy file.
       
   376 */
       
   377 EXPORT_C const TFileName& CQoSLoadEvent::FileName() const
       
   378 	{
       
   379 	return iFileName;
       
   380 	}
       
   381 
       
   382 /**
       
   383 Gets the reason code. 
       
   384  
       
   385 Reason code specifies the success or failure of the request.
       
   386 
       
   387 @publishedPartner
       
   388 @released
       
   389 @capability NetworkServices Restrict QoS operations in similar way as 
       
   390 normal socket operations.
       
   391 @return Reason code.
       
   392 */
       
   393 EXPORT_C TInt CQoSLoadEvent::Reason() const
       
   394 	{
       
   395 	return iReason;
       
   396 	}
       
   397 
       
   398 
       
   399 // CQoSAddEvent
       
   400 /**
       
   401 Constructor.
       
   402 
       
   403 Sets the QoS parameters and reason code.
       
   404 
       
   405 The class takes a reference to the CQoSParameters argument so the caller 
       
   406 must keep that argument in scope whilst this class is being used.
       
   407 
       
   408 @publishedPartner
       
   409 @released
       
   410 @capability NetworkServices Restrict QoS operations in similar way as 
       
   411 normal socket operations.
       
   412 @param aParameters QoS parameters.
       
   413 @param aReason Reason code specifies the success or failure of the request.
       
   414 */
       
   415 EXPORT_C CQoSAddEvent::CQoSAddEvent(CQoSParameters* aParameters, 
       
   416 									TInt aReason) 
       
   417 	: CQoSEventBase(EQoSEventAddPolicy), iReason(aReason)
       
   418 	{
       
   419 	iParameters = aParameters;
       
   420 	}
       
   421 
       
   422 /**
       
   423 Gets the QoS parameters.
       
   424 
       
   425 @publishedPartner
       
   426 @released
       
   427 @capability NetworkServices Restrict QoS operations in similar way as 
       
   428 normal socket operations.
       
   429 @return QoS parameters.
       
   430 */
       
   431 //lint -e{1763} thinks this indirectly modifies class -- wants return to be const?
       
   432 EXPORT_C CQoSParameters* CQoSAddEvent::Parameters() const
       
   433 	{
       
   434 	return iParameters;
       
   435 	}
       
   436 
       
   437 /**
       
   438 Gets the reason code. 
       
   439 
       
   440 Reason code specifies the success or failure of the request.
       
   441 
       
   442 @publishedPartner
       
   443 @released
       
   444 @capability NetworkServices Restrict QoS operations in similar way as 
       
   445 normal socket operations.
       
   446 @return Reason code.
       
   447 */
       
   448 EXPORT_C TInt CQoSAddEvent::Reason() const
       
   449 	{
       
   450 	return iReason;
       
   451 	}
       
   452 
       
   453 
       
   454 // CQoSGetEvent
       
   455 /**
       
   456 Constructor.
       
   457  
       
   458 Sets the QoS parameters and reason code.
       
   459 
       
   460 The class takes a reference to the CQoSParameters argument so the caller 
       
   461 must keep that argument in scope whilst this class is being used.
       
   462 
       
   463 @publishedPartner
       
   464 @released
       
   465 @capability NetworkServices Restrict QoS operations in similar way as 
       
   466 normal socket operations.
       
   467 @param aParameters QoS parameters.
       
   468 @param aReason Reason code specifies the success or failure of the request.
       
   469 */
       
   470 EXPORT_C CQoSGetEvent::CQoSGetEvent(CQoSParameters* aParameters, 
       
   471 									TInt aReason) 
       
   472 	: CQoSEventBase(EQoSEventGetPolicy), iReason(aReason)
       
   473 	{
       
   474 	iParameters = aParameters;
       
   475 	}
       
   476 
       
   477 /**
       
   478 Gets the QoS parameters.
       
   479 
       
   480 @publishedPartner
       
   481 @released
       
   482 @capability NetworkServices Restrict QoS operations in similar way as 
       
   483 normal socket operations.
       
   484 @return QoS parameters.
       
   485 */
       
   486 //lint -e{1763} thinks this indirectly modifies class -- wants return to be const?
       
   487 EXPORT_C CQoSParameters* CQoSGetEvent::Parameters() const
       
   488 	{
       
   489 	return iParameters;
       
   490 	}
       
   491 
       
   492 /**
       
   493 Gets the reason code. 
       
   494  
       
   495 Reason code specifies the success or failure of the request.
       
   496 
       
   497 @publishedPartner
       
   498 @released
       
   499 @capability NetworkServices Restrict QoS operations in similar way as 
       
   500 normal socket operations.
       
   501 @return Reason code.
       
   502 */
       
   503 EXPORT_C TInt CQoSGetEvent::Reason() const
       
   504 	{
       
   505 	return iReason;
       
   506 	}
       
   507 
       
   508 // CQoSDeleteEvent
       
   509 /**
       
   510 Constructor; sets the reason code indicating the success or failure of the 
       
   511 request.
       
   512 
       
   513 @publishedPartner
       
   514 @released
       
   515 @capability NetworkServices Restrict QoS operations in similar way as 
       
   516 normal socket operations.
       
   517 @param aReason Reason code.
       
   518 */
       
   519 EXPORT_C CQoSDeleteEvent::CQoSDeleteEvent(TInt aReason) :
       
   520   CQoSEventBase(EQoSEventDeletePolicy), iReason(aReason)
       
   521 	{
       
   522 	}
       
   523 
       
   524 
       
   525 /**
       
   526 Gets the reason code. 
       
   527 
       
   528 Reason code specifies the success or failure of the request.
       
   529 
       
   530 @publishedPartner
       
   531 @released
       
   532 @capability NetworkServices Restrict QoS operations in similar way as 
       
   533 normal socket operations.
       
   534 @return Reason code.
       
   535 */
       
   536 EXPORT_C TInt CQoSDeleteEvent::Reason() const
       
   537 	{
       
   538 	return iReason;
       
   539 	}
       
   540